diff --git a/Backend/API/handlers/newBuilding.go b/Backend/API/handlers/newBuilding.go
index a3db5cf87adf0c3d80669730720ac42f816ce83a..c1fffbe6f9f1625112d547652e0bec39dcec943a 100644
--- a/Backend/API/handlers/newBuilding.go
+++ b/Backend/API/handlers/newBuilding.go
@@ -11,6 +11,7 @@ func NewBuilding(w http.ResponseWriter, r *http.Request) {
 	w.Header().Set("Access-Control-Allow-Headers", "Content-Type")
 	w.Header().Set("Access-Control-Allow-Origin", ""+other.WebsiteURL)
 	w.Header().Set("Access-Control-Allow-Methods", "POST, PUT, DELETE, OPTIONS")
+	// POST or add building request
 	if r.Method == "POST" {
 		decoder := json.NewDecoder(r.Body)
 		//creates an anonymous struct to reduce clutter in structs file
@@ -23,6 +24,7 @@ func NewBuilding(w http.ResponseWriter, r *http.Request) {
 			println(err.Error())
 			return
 		}
+		//checks if token is still active
 		valid, err := other.IsTokenStillActive(data.SessionToken)
 		if !valid {
 			log.Println("Session token expired or not valid!")
@@ -52,7 +54,7 @@ func NewBuilding(w http.ResponseWriter, r *http.Request) {
 			return
 		}
 
-	} else if r.Method == http.MethodPut {
+	} else if r.Method == http.MethodPut { // PUT or edit building request
 		decoder := json.NewDecoder(r.Body)
 		//creates an anonymous struct to reduce clutter in structs file
 		data := struct {
@@ -65,6 +67,7 @@ func NewBuilding(w http.ResponseWriter, r *http.Request) {
 			println(err.Error())
 			return
 		}
+		// Checks if the token is still valid
 		valid, err := other.IsTokenStillActive(data.SessionToken)
 		if !valid {
 			log.Println("Session token expired or not valid!")
@@ -85,6 +88,7 @@ func NewBuilding(w http.ResponseWriter, r *http.Request) {
 			w.WriteHeader(http.StatusUnauthorized)
 			return
 		}
+		//gets first the userID then uses it to get the company ID the user is connected to
 		UserID, err := other.GetUserIDFromToken(data.SessionToken)
 		if err != nil {
 			log.Println(err.Error())
@@ -111,7 +115,7 @@ func NewBuilding(w http.ResponseWriter, r *http.Request) {
 			w.WriteHeader(http.StatusInternalServerError)
 			return
 		}
-	} else if r.Method == http.MethodDelete {
+	} else if r.Method == http.MethodDelete { // DELETE or delete building request
 		decoder := json.NewDecoder(r.Body)
 		//creates an anonymous struct to reduce clutter in structs file
 		data := struct {
@@ -123,6 +127,7 @@ func NewBuilding(w http.ResponseWriter, r *http.Request) {
 			println(err.Error())
 			return
 		}
+		// Checks if the sessionToken is still active or not
 		valid, err := other.IsTokenStillActive(data.SessionToken)
 		if !valid {
 			log.Println("Session token expired or not valid!")
@@ -143,6 +148,7 @@ func NewBuilding(w http.ResponseWriter, r *http.Request) {
 			w.WriteHeader(http.StatusUnauthorized)
 			return
 		}
+		//gets first the userID then uses it to get the company ID the user is connected to
 		UserID, err := other.GetUserIDFromToken(data.SessionToken)
 		if err != nil {
 			log.Println(err.Error())
@@ -172,6 +178,7 @@ func NewBuilding(w http.ResponseWriter, r *http.Request) {
 	} else if r.Method == http.MethodOptions {
 
 	} else {
+		// If the methods was no one of the allowed once
 		w.WriteHeader(http.StatusMethodNotAllowed)
 	}
 }
diff --git a/Backend/API/handlers/newCompany.go b/Backend/API/handlers/newCompany.go
index 6b31a14e6ce571dbbae518e9d84fbdd67db5f67c..da1f3cd7f0da06fc8e7a32e5a3da712ad3942ab3 100644
--- a/Backend/API/handlers/newCompany.go
+++ b/Backend/API/handlers/newCompany.go
@@ -11,7 +11,9 @@ func NewCompany(w http.ResponseWriter, r *http.Request) {
 	w.Header().Set("Access-Control-Allow-Headers", "Content-Type")
 	w.Header().Set("Access-Control-Allow-Origin", ""+other.ADMIN_WEB_URL)
 	w.Header().Set("Access-Control-Allow-Methods", "POST, OPTIONS")
+	// POST or add company method
 	if r.Method == http.MethodPost {
+		//creates an anonymous struct to reduce clutter in structs file
 		data := struct {
 			SessionToken string `json:"sessionToken"`
 			CompanyName  string `json:"companyName"`
@@ -25,6 +27,7 @@ func NewCompany(w http.ResponseWriter, r *http.Request) {
 			w.WriteHeader(http.StatusBadRequest)
 			return
 		}
+		//gets permissions
 		perm, err := other.GetPermissionFromToken(data.SessionToken)
 		if err != nil {
 			log.Println(err.Error())
@@ -36,10 +39,12 @@ func NewCompany(w http.ResponseWriter, r *http.Request) {
 			w.WriteHeader(http.StatusUnauthorized)
 			return
 		}
+		//nothing can be empty of the required data
 		if data.CompanyName == "" || data.Email == "" || data.Password == "" {
 			w.WriteHeader(http.StatusBadRequest)
 			return
 		}
+		//calls the function to add the company
 		err = other.InsertCompany(data.CompanyName, data.Email, data.Password)
 		if err != nil {
 			log.Println(err.Error())
@@ -50,6 +55,7 @@ func NewCompany(w http.ResponseWriter, r *http.Request) {
 	} else if r.Method == http.MethodOptions {
 
 	} else {
+		// If the methods was no one of the allowed once
 		w.WriteHeader(http.StatusMethodNotAllowed)
 	}
 }
diff --git a/Backend/API/handlers/newDepartment.go b/Backend/API/handlers/newDepartment.go
index 133db262938daee02aadea96fb12918a8e5c5411..258f45221fdb861e3fe0c91b049c8f3800698535 100644
--- a/Backend/API/handlers/newDepartment.go
+++ b/Backend/API/handlers/newDepartment.go
@@ -11,6 +11,7 @@ func NewDepartment(w http.ResponseWriter, r *http.Request) {
 	w.Header().Set("Access-Control-Allow-Headers", "Content-Type")
 	w.Header().Set("Access-Control-Allow-Origin", ""+other.WebsiteURL)
 	w.Header().Set("Access-Control-Allow-Methods", "POST, PUT, DELETE, OPTIONS")
+	// POST or add deparment method
 	if r.Method == "POST" {
 		decoder := json.NewDecoder(r.Body)
 		//creates an anonymous struct to reduce clutter in structs file
@@ -24,6 +25,7 @@ func NewDepartment(w http.ResponseWriter, r *http.Request) {
 			println(err.Error())
 			return
 		}
+		//checks if the session token is still active
 		valid, err := other.IsTokenStillActive(data.SessionToken)
 		if !valid {
 			log.Println("Session token expired or not valid!")
@@ -33,6 +35,7 @@ func NewDepartment(w http.ResponseWriter, r *http.Request) {
 			}
 			return
 		}
+		//gets first the userID then uses it to get the company ID the user is connected to
 		UserID, err := other.GetUserIDFromToken(data.SessionToken)
 		if !valid {
 			log.Println("Session token expired or not valid!")
@@ -66,7 +69,7 @@ func NewDepartment(w http.ResponseWriter, r *http.Request) {
 			return
 		}
 
-	} else if r.Method == http.MethodPut {
+	} else if r.Method == http.MethodPut { // PUT or edit department function
 		decoder := json.NewDecoder(r.Body)
 		//creates an anonymous struct to reduce clutter in structs file
 		data := struct {
@@ -80,6 +83,7 @@ func NewDepartment(w http.ResponseWriter, r *http.Request) {
 			println(err.Error())
 			return
 		}
+		//checks if the session token is still active
 		valid, err := other.IsTokenStillActive(data.SessionToken)
 		if !valid {
 			log.Println("Session token expired or not valid!")
@@ -89,6 +93,7 @@ func NewDepartment(w http.ResponseWriter, r *http.Request) {
 			}
 			return
 		}
+		//gets first the userID then uses it to get the company ID the user is connected to
 		UserID, err := other.GetUserIDFromToken(data.SessionToken)
 		if err != nil {
 			log.Println(err.Error())
@@ -116,7 +121,7 @@ func NewDepartment(w http.ResponseWriter, r *http.Request) {
 			return
 		}
 
-	} else if r.Method == http.MethodDelete {
+	} else if r.Method == http.MethodDelete { //DELETE or delete department method
 		decoder := json.NewDecoder(r.Body)
 		//creates an anonymous struct to reduce clutter in structs file
 		data := struct {
@@ -128,6 +133,7 @@ func NewDepartment(w http.ResponseWriter, r *http.Request) {
 			println(err.Error())
 			return
 		}
+		//checks if the session token is still active
 		valid, err := other.IsTokenStillActive(data.SessionToken)
 		if !valid {
 			log.Println("Session token expired or not valid!")
@@ -148,6 +154,7 @@ func NewDepartment(w http.ResponseWriter, r *http.Request) {
 			w.WriteHeader(http.StatusUnauthorized)
 			return
 		}
+		//gets first the userID then uses it to get the company ID the user is connected to
 		UserID, err := other.GetUserIDFromToken(data.SessionToken)
 		if err != nil {
 			log.Println(err.Error())
@@ -179,6 +186,7 @@ func NewDepartment(w http.ResponseWriter, r *http.Request) {
 	} else if r.Method == http.MethodOptions {
 
 	} else {
+		// If the methods was no one of the allowed once
 		w.WriteHeader(http.StatusMethodNotAllowed)
 	}
 }
diff --git a/Backend/API/handlers/newEnok.go b/Backend/API/handlers/newEnok.go
index 1b468789d6de3543cbd9fec82bf5c719b8e76119..7dde83e4c9eaa9943c1a35c6e99fd3b63940e230 100644
--- a/Backend/API/handlers/newEnok.go
+++ b/Backend/API/handlers/newEnok.go
@@ -11,6 +11,7 @@ func NewEnoek(w http.ResponseWriter, r *http.Request) {
 	w.Header().Set("Access-Control-Allow-Headers", "Content-Type")
 	w.Header().Set("Access-Control-Allow-Origin", ""+other.WebsiteURL)
 	w.Header().Set("Access-Control-Allow-Methods", "POST, PUT, DELETE, OPTIONS")
+	//POST or add new enoek suggestion method
 	if r.Method == "POST" {
 		decoder := json.NewDecoder(r.Body)
 		//creates an anonymous struct to reduce clutter in structs file
@@ -24,6 +25,7 @@ func NewEnoek(w http.ResponseWriter, r *http.Request) {
 			println(err.Error())
 			return
 		}
+		//checks if the session token is still active
 		valid, err := other.IsTokenStillActive(data.SessionToken)
 		if !valid {
 			log.Println("Session token expired or not valid!")
@@ -44,6 +46,7 @@ func NewEnoek(w http.ResponseWriter, r *http.Request) {
 			w.WriteHeader(http.StatusUnauthorized)
 			return
 		}
+		//gets first the userID then uses it to get the company ID the user is connected to
 		UserID, err := other.GetUserIDFromToken(data.SessionToken)
 		if err != nil {
 			log.Println(err.Error())
@@ -56,19 +59,19 @@ func NewEnoek(w http.ResponseWriter, r *http.Request) {
 			w.WriteHeader(http.StatusInternalServerError)
 			return
 		}
-
+		// add the data to a temp struct
 		dbProcess := other.Processes{
 			Name:      data.ProcessName,
 			CompanyID: CompID,
 		}
-
+		//get the process
 		process, err := other.GetProcessIDByName(dbProcess)
 		if err != nil {
 			log.Println(err.Error())
 			w.WriteHeader(http.StatusBadRequest)
 			return
 		}
-
+		//another temp struct to store data
 		dbEnoek := other.EnokSuggestionMeasures{
 			Header:      data.Enoek.Header,
 			StartDate:   data.Enoek.StartDate,
@@ -84,7 +87,7 @@ func NewEnoek(w http.ResponseWriter, r *http.Request) {
 			return
 		}
 
-	} else if r.Method == http.MethodPut {
+	} else if r.Method == http.MethodPut { //PUT or approve/disapprove the neoek suggestion
 		decoder := json.NewDecoder(r.Body)
 		//creates an anonymous struct to reduce clutter in structs file
 		data := struct {
@@ -97,6 +100,7 @@ func NewEnoek(w http.ResponseWriter, r *http.Request) {
 			println(err.Error())
 			return
 		}
+		//checks if the session token is still active
 		valid, err := other.IsTokenStillActive(data.SessionToken)
 		if !valid {
 			log.Println("Session token expired or not valid!")
@@ -125,7 +129,7 @@ func NewEnoek(w http.ResponseWriter, r *http.Request) {
 			w.WriteHeader(http.StatusInternalServerError)
 			return
 		}
-	} else if r.Method == http.MethodDelete {
+	} else if r.Method == http.MethodDelete { //DELETE or delete a enoek suggestion/post
 		decoder := json.NewDecoder(r.Body)
 		//creates an anonymous struct to reduce clutter in structs file
 		data := struct {
@@ -137,6 +141,7 @@ func NewEnoek(w http.ResponseWriter, r *http.Request) {
 			println(err.Error())
 			return
 		}
+		//checks if the session token is still active
 		valid, err := other.IsTokenStillActive(data.SessionToken)
 		if !valid {
 			log.Println("Session token expired or not valid!")
@@ -168,6 +173,7 @@ func NewEnoek(w http.ResponseWriter, r *http.Request) {
 	} else if r.Method == http.MethodOptions {
 
 	} else {
+		// If the methods was no one of the allowed once
 		w.WriteHeader(http.StatusMethodNotAllowed)
 	}
 }
diff --git a/Backend/API/handlers/newGateway.go b/Backend/API/handlers/newGateway.go
index 5a16b13cfe1120fa7f4b9d7e7b2a23b5bcad9a45..5e8fdd8722c0564dcf8da2bffe071bb562b9858f 100644
--- a/Backend/API/handlers/newGateway.go
+++ b/Backend/API/handlers/newGateway.go
@@ -12,6 +12,7 @@ func AddGateway(w http.ResponseWriter, r *http.Request) {
 	w.Header().Set("Access-Control-Allow-Headers", "Content-Type")
 	w.Header().Set("Access-Control-Allow-Origin", ""+other.WebsiteURL)
 	w.Header().Set("Access-Control-Allow-Methods", "POST, DELETE, PUT, OPTIONS")
+	//POST or add a gateway method
 	if r.Method == http.MethodPost {
 		decoder := json.NewDecoder(r.Body)
 		//creates an anonymous struct to reduce clutter in structs file
@@ -25,7 +26,7 @@ func AddGateway(w http.ResponseWriter, r *http.Request) {
 			println(err.Error())
 			return
 		}
-
+		//checks if the session token is still active
 		valid, err := other.IsTokenStillActive(data.Token)
 		if !valid {
 			w.WriteHeader(http.StatusUnauthorized)
@@ -43,13 +44,14 @@ func AddGateway(w http.ResponseWriter, r *http.Request) {
 			w.WriteHeader(http.StatusInternalServerError)
 			return
 		}
+		//adds the gateway to the database
 		err = other.AddGateway(data.Token, data.Eui, data.Name)
 		if err != nil {
 			log.Println(err.Error())
 			w.WriteHeader(http.StatusInternalServerError)
 			return
 		}
-	} else if r.Method == http.MethodPut {
+	} else if r.Method == http.MethodPut { //PUT or edit gateway method
 		decoder := json.NewDecoder(r.Body)
 		//creates an anonymous struct to reduce clutter in structs file
 		data := struct {
@@ -64,6 +66,7 @@ func AddGateway(w http.ResponseWriter, r *http.Request) {
 			println(err.Error())
 			return
 		}
+		//checks if the session token is still active
 		valid, err := other.IsTokenStillActive(data.Token)
 		if !valid {
 			log.Println("Session token expired or not valid!")
@@ -84,6 +87,7 @@ func AddGateway(w http.ResponseWriter, r *http.Request) {
 			w.WriteHeader(http.StatusUnauthorized)
 			return
 		}
+		//gets first the userID then uses it to get the company ID the user is connected to
 		UserID, err := other.GetUserIDFromToken(data.Token)
 		if err != nil {
 			log.Println(err.Error())
@@ -103,7 +107,7 @@ func AddGateway(w http.ResponseWriter, r *http.Request) {
 			w.WriteHeader(http.StatusInternalServerError)
 			return
 		}
-	} else if r.Method == http.MethodDelete {
+	} else if r.Method == http.MethodDelete { //DELETE or delete gateway method
 		decoder := json.NewDecoder(r.Body)
 		//creates an anonymous struct to reduce clutter in structs file
 		data := struct {
@@ -115,7 +119,7 @@ func AddGateway(w http.ResponseWriter, r *http.Request) {
 			println(err.Error())
 			return
 		}
-
+		//checks if the session token is still active
 		valid, err := other.IsTokenStillActive(data.Token)
 		if !valid {
 			w.WriteHeader(http.StatusUnauthorized)
@@ -125,12 +129,14 @@ func AddGateway(w http.ResponseWriter, r *http.Request) {
 			}
 			return
 		}
+		//chirpstack request to delete the gateway
 		err = other.DoNewRequest(nil, other.CHIRP_URL+"api/gateways/"+data.Eui, http.MethodDelete)
 		if err != nil {
 			log.Println(err.Error())
 			w.WriteHeader(http.StatusInternalServerError)
 			return
 		}
+		//deletes the gateway in the database
 		err = other.DeleteGateway(data.Eui)
 		if err != nil {
 			log.Println(err.Error())
@@ -141,6 +147,7 @@ func AddGateway(w http.ResponseWriter, r *http.Request) {
 	} else if r.Method == http.MethodOptions {
 
 	} else {
+		// If the methods was no one of the allowed once
 		w.WriteHeader(http.StatusMethodNotAllowed)
 	}
 }
diff --git a/Backend/API/handlers/newHotdrop.go b/Backend/API/handlers/newHotdrop.go
index 76b03bb29922b74fd0998d8167c57c322cf3cbf0..e9c0a6c84b08523bdabe9c7aa4d5b964ee48d04c 100644
--- a/Backend/API/handlers/newHotdrop.go
+++ b/Backend/API/handlers/newHotdrop.go
@@ -12,6 +12,7 @@ func NewHotDrop(w http.ResponseWriter, r *http.Request) {
 	w.Header().Set("Access-Control-Allow-Headers", "Content-Type")
 	w.Header().Set("Access-Control-Allow-Origin", ""+other.WebsiteURL)
 	w.Header().Set("Access-Control-Allow-Methods", "POST, PUT, DELETE, OPTIONS")
+	//POST or add sensor/hotdrop method
 	if r.Method == "POST" {
 		decoder := json.NewDecoder(r.Body)
 		//creates an anonymous struct to reduce clutter in structs file
@@ -32,6 +33,7 @@ func NewHotDrop(w http.ResponseWriter, r *http.Request) {
 			w.WriteHeader(http.StatusBadRequest)
 			return
 		}
+		//checks if the session token is still active
 		valid, err := other.IsTokenStillActive(data.SessionToken)
 		if !valid {
 			log.Println("Session token expired or not valid!")
@@ -41,6 +43,7 @@ func NewHotDrop(w http.ResponseWriter, r *http.Request) {
 			}
 			return
 		}
+		//gets first the userID then uses it to get the company ID the user is connected to
 		UserID, err := other.GetUserIDFromToken(data.SessionToken)
 		if err != nil {
 			log.Println(err.Error())
@@ -89,6 +92,7 @@ func NewHotDrop(w http.ResponseWriter, r *http.Request) {
 			DepartmentID: department,
 			Voltage:      data.Voltage,
 		}
+		//adds the sensor to the database
 		err = other.InsertSensor(dbMachine, 0)
 		if err != nil {
 			log.Println(err.Error())
@@ -96,7 +100,7 @@ func NewHotDrop(w http.ResponseWriter, r *http.Request) {
 			return
 		}
 
-	} else if r.Method == http.MethodPut {
+	} else if r.Method == http.MethodPut { //PUT or edit sensor in database
 		decoder := json.NewDecoder(r.Body)
 		//creates an anonymous struct to reduce clutter in structs file
 		data := struct {
@@ -115,6 +119,7 @@ func NewHotDrop(w http.ResponseWriter, r *http.Request) {
 			w.WriteHeader(http.StatusBadRequest)
 			return
 		}
+		//checks if the session token is still active
 		valid, err := other.IsTokenStillActive(data.SessionToken)
 		if !valid {
 			log.Println("Session token expired or not valid!")
@@ -124,6 +129,7 @@ func NewHotDrop(w http.ResponseWriter, r *http.Request) {
 			}
 			return
 		}
+		//gets first the userID then uses it to get the company ID the user is connected to
 		UserID, err := other.GetUserIDFromToken(data.SessionToken)
 		if err != nil {
 			log.Println(err.Error())
@@ -162,7 +168,7 @@ func NewHotDrop(w http.ResponseWriter, r *http.Request) {
 			DepartmentID: department,
 			Voltage:      data.Voltage,
 		}
-
+		//edits the sensor in database
 		err = other.EditSensor(dbMachine)
 		if err != nil {
 			log.Println(err.Error())
@@ -181,6 +187,7 @@ func NewHotDrop(w http.ResponseWriter, r *http.Request) {
 			println(err.Error())
 			return
 		}
+		//checks if the session token is still active
 		valid, err := other.IsTokenStillActive(data.SessionToken)
 		if !valid {
 			log.Println("Session token expired or not valid!")
@@ -190,14 +197,14 @@ func NewHotDrop(w http.ResponseWriter, r *http.Request) {
 			}
 			return
 		}
-
+		//Deletes the hotdrop/sensor in chirpstack
 		err = other.DoNewRequest(nil, other.CHIRP_URL+"api/devices/"+data.Eui, http.MethodDelete)
 		if err != nil {
 			log.Println(err.Error())
 			w.WriteHeader(http.StatusInternalServerError)
 			return
 		}
-
+		//deletes the sensor in database
 		err = other.DeleteSensor(data.Eui)
 		if err != nil {
 			log.Println(err.Error())
@@ -208,6 +215,7 @@ func NewHotDrop(w http.ResponseWriter, r *http.Request) {
 	} else if r.Method == http.MethodOptions {
 
 	} else {
+		// If the methods was no one of the allowed once
 		w.WriteHeader(http.StatusMethodNotAllowed)
 	}
 }
diff --git a/Backend/API/handlers/newProcess.go b/Backend/API/handlers/newProcess.go
index e7b2bb03e7c237ac0715097f0473f432e4071005..ed1aaca5ca4bd4351182af1c6ac72b8fed8afb30 100644
--- a/Backend/API/handlers/newProcess.go
+++ b/Backend/API/handlers/newProcess.go
@@ -11,6 +11,7 @@ func NewProcess(w http.ResponseWriter, r *http.Request) {
 	w.Header().Set("Access-Control-Allow-Headers", "Content-Type")
 	w.Header().Set("Access-Control-Allow-Origin", ""+other.WebsiteURL)
 	w.Header().Set("Access-Control-Allow-Methods", "POST, PUT, DELETE, OPTIONS")
+	//POST or add process method
 	if r.Method == "POST" {
 		decoder := json.NewDecoder(r.Body)
 		//creates an anonymous struct to reduce clutter in structs file
@@ -24,6 +25,7 @@ func NewProcess(w http.ResponseWriter, r *http.Request) {
 			println(err.Error())
 			return
 		}
+		//checks if the session token is still active
 		valid, err := other.IsTokenStillActive(data.SessionToken)
 		if !valid {
 			log.Println("Session token expired or not valid!")
@@ -44,6 +46,7 @@ func NewProcess(w http.ResponseWriter, r *http.Request) {
 			w.WriteHeader(http.StatusUnauthorized)
 			return
 		}
+		//temp process storage
 		process := other.Processes{
 			Name:        data.ProcessName,
 			Description: data.Description,
@@ -56,7 +59,7 @@ func NewProcess(w http.ResponseWriter, r *http.Request) {
 			return
 		}
 
-	} else if r.Method == http.MethodPut {
+	} else if r.Method == http.MethodPut { //PUT or edit process method
 		decoder := json.NewDecoder(r.Body)
 		//creates an anonymous struct to reduce clutter in structs file
 		data := struct {
@@ -71,6 +74,7 @@ func NewProcess(w http.ResponseWriter, r *http.Request) {
 			println(err.Error())
 			return
 		}
+		//checks if the session token is still active
 		valid, err := other.IsTokenStillActive(data.SessionToken)
 		if !valid {
 			log.Println("Session token expired or not valid!")
@@ -91,6 +95,7 @@ func NewProcess(w http.ResponseWriter, r *http.Request) {
 			w.WriteHeader(http.StatusUnauthorized)
 			return
 		}
+		//gets first the userID then uses it to get the company ID the user is connected to
 		UserID, err := other.GetUserIDFromToken(data.SessionToken)
 		if err != nil {
 			log.Println(err.Error())
@@ -103,17 +108,20 @@ func NewProcess(w http.ResponseWriter, r *http.Request) {
 			w.WriteHeader(http.StatusInternalServerError)
 			return
 		}
+		//old process storage
 		oldProcess := other.Processes{
 			Name:        data.ProcessName1,
 			Description: data.Description1,
 			CompanyID:   CompID,
 		}
+		//gets the id of the process that is getting edited
 		processId, err := other.GetProcessIDByName(oldProcess)
 		if err != nil {
 			log.Println(err.Error())
 			w.WriteHeader(http.StatusBadRequest)
 			return
 		}
+		//temp storage for the new/updated process
 		newProcess := other.Processes{
 			ID:          processId,
 			Name:        data.ProcessName2,
@@ -126,7 +134,7 @@ func NewProcess(w http.ResponseWriter, r *http.Request) {
 			w.WriteHeader(http.StatusInternalServerError)
 			return
 		}
-	} else if r.Method == http.MethodDelete {
+	} else if r.Method == http.MethodDelete { //DELETE or delete process method
 		decoder := json.NewDecoder(r.Body)
 		//creates an anonymous struct to reduce clutter in structs file
 		data := struct {
@@ -139,6 +147,7 @@ func NewProcess(w http.ResponseWriter, r *http.Request) {
 			println(err.Error())
 			return
 		}
+		//checks if the session token is still active
 		valid, err := other.IsTokenStillActive(data.SessionToken)
 		if !valid {
 			log.Println("Session token expired or not valid!")
@@ -159,6 +168,7 @@ func NewProcess(w http.ResponseWriter, r *http.Request) {
 			w.WriteHeader(http.StatusUnauthorized)
 			return
 		}
+		//gets first the userID then uses it to get the company ID the user is connected to
 		UserID, err := other.GetUserIDFromToken(data.SessionToken)
 		if err != nil {
 			log.Println(err.Error())
@@ -171,11 +181,13 @@ func NewProcess(w http.ResponseWriter, r *http.Request) {
 			w.WriteHeader(http.StatusInternalServerError)
 			return
 		}
+		//temp storage for the process
 		oldProcess := other.Processes{
 			Name:        data.ProcessName,
 			Description: data.Description,
 			CompanyID:   CompID,
 		}
+		//gets the process ID for the oldprocess
 		processId, err := other.GetProcessIDByName(oldProcess)
 		if err != nil {
 			log.Println(err.Error())
@@ -192,6 +204,7 @@ func NewProcess(w http.ResponseWriter, r *http.Request) {
 	} else if r.Method == http.MethodOptions {
 
 	} else {
+		// If the methods was no one of the allowed once
 		w.WriteHeader(http.StatusMethodNotAllowed)
 	}
 }
@@ -201,9 +214,9 @@ func ProcessMachine(w http.ResponseWriter, r *http.Request) {
 	w.Header().Set("Access-Control-Allow-Methods", "POST, PUT, DELETE, OPTIONS")
 	if r.Method == "POST" {
 
-	} else if r.Method == http.MethodPut {
+	} else if r.Method == http.MethodPut { //PUT or edit process machines method
 		decoder := json.NewDecoder(r.Body)
-
+		//gets all data that is changed
 		type RequestBody struct {
 			Data []struct {
 				AddOrNot   bool   `json:"added"`
@@ -219,7 +232,7 @@ func ProcessMachine(w http.ResponseWriter, r *http.Request) {
 			println(err.Error())
 			return
 		}
-		log.Println(requestBody.SessionToken)
+		//checks if the session token is still active
 		valid, err := other.IsTokenStillActive(requestBody.SessionToken)
 		if !valid {
 			log.Println("Session token expired or not valid!")
@@ -241,7 +254,7 @@ func ProcessMachine(w http.ResponseWriter, r *http.Request) {
 			return
 		}
 		for _, item := range requestBody.Data {
-			//calls function to add building
+			//calls function to add or delete a connection between processes and sensors based upon the AddOrNot
 			err = other.EditSensorToProcess(item.AddOrNot, item.ProcessId, item.MachineEUI)
 			if err != nil {
 				println(err.Error())
@@ -262,6 +275,7 @@ func ProcessMachine(w http.ResponseWriter, r *http.Request) {
 			println(err.Error())
 			return
 		}
+		//checks if the session token is still active
 		valid, err := other.IsTokenStillActive(data.SessionToken)
 		if !valid {
 			log.Println("Session token expired or not valid!")
@@ -282,6 +296,7 @@ func ProcessMachine(w http.ResponseWriter, r *http.Request) {
 			w.WriteHeader(http.StatusUnauthorized)
 			return
 		}
+		//gets first the userID then uses it to get the company ID the user is connected to
 		UserID, err := other.GetUserIDFromToken(data.SessionToken)
 		if err != nil {
 			log.Println(err.Error())
@@ -315,6 +330,7 @@ func ProcessMachine(w http.ResponseWriter, r *http.Request) {
 	} else if r.Method == http.MethodOptions {
 
 	} else {
+		// If the methods was no one of the allowed once
 		w.WriteHeader(http.StatusMethodNotAllowed)
 	}
 }
diff --git a/Backend/API/handlers/newUser.go b/Backend/API/handlers/newUser.go
index e3053224dd65d1e5833675d11892f08f164c3b6c..1926d5b090d40e38348bf7f155be8165f68c0d8a 100644
--- a/Backend/API/handlers/newUser.go
+++ b/Backend/API/handlers/newUser.go
@@ -12,6 +12,7 @@ func NewUser(w http.ResponseWriter, r *http.Request) {
 	w.Header().Set("Access-Control-Allow-Headers", "Content-Type")
 	w.Header().Set("Access-Control-Allow-Origin", ""+other.WebsiteURL)
 	w.Header().Set("Access-Control-Allow-Methods", "POST, PUT, DELETE, OPTIONS")
+	//POST or add user method
 	if r.Method == "POST" {
 		//decode all required json data
 		userData := struct {
@@ -45,8 +46,9 @@ func NewUser(w http.ResponseWriter, r *http.Request) {
 			w.WriteHeader(http.StatusInternalServerError)
 			return
 		}
+		//adds the user to the database
 		err = other.InsertUser(userData.SessionToken, userData.User.Email, userData.User.FirstName, userData.User.LastName, string(Hash), userData.User.Permission)
-	} else if r.Method == http.MethodPut {
+	} else if r.Method == http.MethodPut { //PUT or edit user method
 		//decode all required json data
 		userData := struct {
 			SessionToken string      `json:"sessionToken"`
@@ -85,7 +87,7 @@ func NewUser(w http.ResponseWriter, r *http.Request) {
 			w.WriteHeader(http.StatusInternalServerError)
 			return
 		}
-	} else if r.Method == http.MethodDelete {
+	} else if r.Method == http.MethodDelete { //DELETE or delete user method
 		userData := struct {
 			SessionToken string `json:"sessionToken"`
 			UserID       int    `json:"userID"`
@@ -119,6 +121,7 @@ func NewUser(w http.ResponseWriter, r *http.Request) {
 	} else if r.Method == http.MethodOptions {
 
 	} else {
+		// If the methods was no one of the allowed once
 		w.WriteHeader(http.StatusMethodNotAllowed)
 	}
 }
diff --git a/Backend/API/other/sqlqueries.go b/Backend/API/other/sqlqueries.go
index 87575eafe1e7cd2b66dc6651bf606ed53ca34ebd..cf35c92f7d2e936c93b729b878e86751d6374178 100644
--- a/Backend/API/other/sqlqueries.go
+++ b/Backend/API/other/sqlqueries.go
@@ -19,6 +19,7 @@ func GetUserIDFromToken(token string) (int, error) {
 	return userID, nil
 }
 
+// Gets Comapny Id by using the userID
 func GetCompanyFromUserID(userID int) (int, error) {
 	var companyID int
 	// Query to retrieve company ID based on user ID
@@ -29,6 +30,7 @@ func GetCompanyFromUserID(userID int) (int, error) {
 	return companyID, nil
 }
 
+// Gets the permission level from the session token from the user
 func GetPermissionFromToken(token string) (int, error) {
 	var permission int
 	// Query to retrieve user ID based on session token
@@ -40,6 +42,7 @@ func GetPermissionFromToken(token string) (int, error) {
 }
 
 /*USER FUNCTIONS*/
+// Insert new user with the token of the user to get the company the user is adding to
 func InsertUser(token string, email string, firstName string, lastName string, password string, permission int) error {
 
 	//gets userID
@@ -62,6 +65,8 @@ func InsertUser(token string, email string, firstName string, lastName string, p
 
 	return nil
 }
+
+// Edits the user based on new inserted values,
 func EditUser(userID int, email string, firstName string, lastName string, password string, permission int) error {
 	_, err := DB.Exec("UPDATE users SET email=?, first_name=?, last_name=?, password=?, permission=? WHERE id=?", email, firstName, lastName, password, permission, userID)
 	if err != nil {
@@ -69,6 +74,8 @@ func EditUser(userID int, email string, firstName string, lastName string, passw
 	}
 	return nil
 }
+
+// Delete user with user ID
 func DeleteUser(userID int) error {
 	_, err := DB.Exec("DELETE FROM session WHERE user_id=?", userID)
 	if err != nil {
@@ -83,6 +90,7 @@ func DeleteUser(userID int) error {
 }
 
 /*BUILDING FUNCTIONS*/
+// Insert a new building
 func InsertBuilding(token string, name string) error {
 	//gets userID
 	userID, err := GetUserIDFromToken(token)
@@ -102,6 +110,8 @@ func InsertBuilding(token string, name string) error {
 
 	return nil
 }
+
+// Edit an allready existing building
 func EditBuilding(id int, name string) error {
 	_, err := DB.Exec("UPDATE building set name=? WHERE id=?", name, id)
 	if err != nil {
@@ -110,6 +120,8 @@ func EditBuilding(id int, name string) error {
 
 	return nil
 }
+
+// Delete a building from its table and from every values that uses the building ID in the other tables
 func DeleteBuilding(id int) error {
 	rows, err := DB.Query("SELECT eui FROM machine WHERE building_id = ?", id)
 	if err != nil {
@@ -157,6 +169,8 @@ func DeleteBuilding(id int) error {
 
 	return nil
 }
+
+// Get building Id by its name with help of comapny ID
 func GetBuildingIdByName(name string, compId int) (int, error) {
 	var id = 0
 	row := DB.QueryRow("SELECT id FROM building WHERE name=? AND company_id=?", name, compId)
@@ -168,14 +182,16 @@ func GetBuildingIdByName(name string, compId int) (int, error) {
 }
 
 /*DEPARTMENT FUNCTIONS*/
+// Insert department for a building that exist
 func InsertDepartment(buildingID int, name string) error {
-
 	_, err := DB.Exec("INSERT INTO department (building_id, name) VALUES (?, ?)", buildingID, name)
 	if err != nil {
 		return err
 	}
 	return nil
 }
+
+// Edit existing department
 func EditDepartment(id int, name string) error {
 	_, err := DB.Exec("UPDATE department set name=? WHERE id=?", name, id)
 	if err != nil {
@@ -184,6 +200,8 @@ func EditDepartment(id int, name string) error {
 
 	return nil
 }
+
+// Delete department from department table and set it to NULL in the machines that uses it
 func DeleteDepartment(id int) error {
 	_, err := DB.Exec("UPDATE machine set department_id=NULL WHERE department_id=?", id)
 	if err != nil {
@@ -197,6 +215,8 @@ func DeleteDepartment(id int) error {
 
 	return nil
 }
+
+// Get department ID by using the company ID and name of the department
 func GetDepartmentIdByName(name string, compId int) (int, error) {
 	var id = 0
 	row := DB.QueryRow("SELECT id FROM department WHERE name=? AND building_id IN (SELECT id FROM building WHERE company_id=?)", name, compId)
@@ -208,6 +228,7 @@ func GetDepartmentIdByName(name string, compId int) (int, error) {
 }
 
 /*ENOEK FUNCTIONS*/
+// Adds a Enoek suggestion
 func InsertEnoek(token string, measures EnokSuggestionMeasures) error {
 	//gets userID
 	userID, err := GetUserIDFromToken(token)
@@ -221,6 +242,8 @@ func InsertEnoek(token string, measures EnokSuggestionMeasures) error {
 	}
 	return nil
 }
+
+// Makes it approved or not
 func EnoekJudgement(enoekID int, approved bool) error {
 	_, err := DB.Exec("UPDATE enoek_suggestion_measures SET approved=? WHERE id=?", approved, enoekID)
 	if err != nil {
@@ -228,6 +251,8 @@ func EnoekJudgement(enoekID int, approved bool) error {
 	}
 	return nil
 }
+
+// Says it is acitve or not
 func EnoekActiveOrNot(enoekID int, active bool) error {
 	_, err := DB.Exec("UPDATE enoek_suggestion_measures SET active=? WHERE id=?", active, enoekID)
 	if err != nil {
@@ -235,6 +260,8 @@ func EnoekActiveOrNot(enoekID int, active bool) error {
 	}
 	return nil
 }
+
+// Delete a Enoek post
 func DeleteEnoek(id int) error {
 	_, err := DB.Exec("DELETE FROM enoek_suggestion_measures WHERE id=?", id)
 	if err != nil {
@@ -244,6 +271,7 @@ func DeleteEnoek(id int) error {
 }
 
 /*COMPANY FUNCTIONS*/
+// Insert a new comapny with a admin user
 func InsertCompany(name string, email string, password string) error {
 	_, err := DB.Exec("INSERT INTO company (name) VALUES (?)", name)
 	if err != nil {
@@ -265,6 +293,8 @@ func InsertCompany(name string, email string, password string) error {
 	}
 	return nil
 }
+
+// Edit the company
 func EditCompany(id int, name string) error {
 	_, err := DB.Exec("UPDATE company SET name=? WHERE id=?", name, id)
 	if err != nil {
@@ -274,6 +304,7 @@ func EditCompany(id int, name string) error {
 }
 
 /*SENSOR FUNCTIONS*/
+// Insert a new sensor with or without a department
 func InsertSensor(machine Machine, processID int) error {
 	if machine.DepartmentID != 0 {
 		_, err := DB.Exec(`
@@ -307,6 +338,8 @@ func InsertSensor(machine Machine, processID int) error {
 
 	return nil
 }
+
+// Edit a sensor with its EUI but not able to edit the EUI
 func EditSensor(machine Machine) error {
 	if machine.DepartmentID != 0 {
 		_, err := DB.Exec(`
@@ -325,6 +358,8 @@ func EditSensor(machine Machine) error {
 	}
 	return nil
 }
+
+// Delete a sensor
 func DeleteSensor(eui string) error {
 	_, err := DB.Exec(`
 		DELETE FROM sensorData WHERE eui=?`,
@@ -347,6 +382,7 @@ func DeleteSensor(eui string) error {
 	return nil
 }
 
+// Insert sensor data that the sensors collect
 func InsertSensorData(data SensorData) error {
 	_, err := DB.Exec(`
 		INSERT INTO sensorData (eui, Acumulation, AVG_current, Offset_max, Offset_min, Voltage, Temprature, date_time)
@@ -368,6 +404,7 @@ func ClearSensorData() error {
 }
 
 /*PROCESS FUNCTIONS*/
+// Insert a new process
 func InsertProcess(token string, processes Processes) error {
 	//gets userID
 	userID, err := GetUserIDFromToken(token)
@@ -386,6 +423,8 @@ func InsertProcess(token string, processes Processes) error {
 	}
 	return nil
 }
+
+// Edit a process
 func EditProcess(processes Processes) error {
 	_, err := DB.Exec("UPDATE processes set name=?, description=? WHERE id=?", processes.Name, processes.Description, processes.ID)
 	if err != nil {
@@ -394,6 +433,8 @@ func EditProcess(processes Processes) error {
 
 	return nil
 }
+
+// Delete a process
 func DeleteProcess(id int) error {
 
 	_, err := DB.Exec("DELETE FROM enoek_suggestion_measures WHERE process_id=?", id)
@@ -414,6 +455,7 @@ func DeleteProcess(id int) error {
 	return nil
 }
 
+// gets process ID with its name and companyID
 func GetProcessIDByName(processes Processes) (int, error) {
 	var id = 0
 	if processes.Description != "" {
@@ -434,6 +476,7 @@ func GetProcessIDByName(processes Processes) (int, error) {
 }
 
 /*SENSOR PROCESS FUNCTIONS*/
+// Add sensor to to processMachines so that they are connected
 func AddSensorToProcess(maPro MachineProcesses) error {
 	_, err := DB.Exec("INSERT INTO machine_processes (machine_id, processes_id) VALUES (?, ?)", maPro.MachineID, maPro.ProcessesID)
 	if err != nil {
@@ -441,6 +484,8 @@ func AddSensorToProcess(maPro MachineProcesses) error {
 	}
 	return nil
 }
+
+// Adds or deletes a sensor to a process
 func EditSensorToProcess(addOrNot bool, processId int, machineEUI string) error {
 	if addOrNot {
 		_, err := DB.Exec("INSERT INTO machine_processes (machine_id, processes_id) VALUES (?, ?)", machineEUI, processId)
@@ -456,6 +501,8 @@ func EditSensorToProcess(addOrNot bool, processId int, machineEUI string) error
 
 	return nil
 }
+
+// Deletes a sensor from a process
 func DeleteSensorToProcess(maPro MachineProcesses) error {
 	_, err := DB.Exec("DELETE FROM machine_processes WHERE machine_id=? AND processes_id=? ", maPro.MachineID, maPro.ProcessesID)
 	if err != nil {
@@ -465,6 +512,7 @@ func DeleteSensorToProcess(maPro MachineProcesses) error {
 }
 
 /*GATEWAY FUNCTIONS*/
+// Adds a gateway
 func AddGateway(token string, eui string, name string) error {
 	//gets userID
 	userID, err := GetUserIDFromToken(token)
@@ -482,6 +530,8 @@ func AddGateway(token string, eui string, name string) error {
 	}
 	return nil
 }
+
+// edits a gateway
 func EditGateway(newEui string, oldEui string, newName string, oldName string, compId int) error {
 	_, err := DB.Exec("UPDATE gateway SET eui=?, name=? where eui=? AND name=? AND company_id=?", newEui, newName, oldEui, oldName, compId)
 	if err != nil {
@@ -489,6 +539,8 @@ func EditGateway(newEui string, oldEui string, newName string, oldName string, c
 	}
 	return nil
 }
+
+// Deltes a gateway
 func DeleteGateway(eui string) error {
 	_, err := DB.Exec("DELETE FROM gateway where eui=?", eui)
 	if err != nil {
@@ -497,6 +549,7 @@ func DeleteGateway(eui string) error {
 	return nil
 }
 
+// Functions to find out if a session token is still active or not
 func IsTokenStillActive(sessionToken string) (bool, error) {
 
 	var expires time.Time
diff --git a/Backend/EgressAPI/other/sqlqueries.go b/Backend/EgressAPI/other/sqlqueries.go
index fb59504a3147637fbbdf54241cccaa3eb4077e97..6c65afb70771e53700e336072cb1247a7284f19a 100644
--- a/Backend/EgressAPI/other/sqlqueries.go
+++ b/Backend/EgressAPI/other/sqlqueries.go
@@ -10,6 +10,7 @@ import (
 	"time"
 )
 
+// Gets the UserID with email of the user
 func getUserIDFromEmail(email string) (int, error) {
 	var userId int
 	err := DB.QueryRow("SELECT id FROM users WHERE email = ?", email).Scan(&userId)
@@ -19,6 +20,7 @@ func getUserIDFromEmail(email string) (int, error) {
 	return userId, nil
 }
 
+// gets the hashed stored password from the email
 func GetHashedPasswordFromEmail(email string) ([]byte, error) {
 	var hashString string
 	id, err := getUserIDFromEmail(email) //get from token
@@ -34,6 +36,7 @@ func GetHashedPasswordFromEmail(email string) ([]byte, error) {
 	return hash, nil
 }
 
+// gets userID from session token
 func getUserIDFromToken(token string) (int, error) {
 	var userID int
 	// Query to retrieve user ID based on session token
@@ -43,16 +46,8 @@ func getUserIDFromToken(token string) (int, error) {
 	}
 	return userID, nil
 }
-func GetUserIDFromEmail(email string) (int, error) {
-	var userID int
-	// Query to retrieve user ID based on email
-	err := DB.QueryRow("SELECT id FROM users WHERE email = ?", email).Scan(&userID)
-	if err != nil {
-		return 0, err
-	}
-	return userID, nil
-}
 
+// Gets the company ID for a user in that company
 func getCompanyFromUserID(userID int) (int, error) {
 	var companyID int
 	// Query to retrieve company ID based on user ID
@@ -63,6 +58,7 @@ func getCompanyFromUserID(userID int) (int, error) {
 	return companyID, nil
 }
 
+// Gets the premission clearence a user has
 func GetPermissionFromToken(token string) (int, error) {
 	var permission int
 	// Query to retrieve user ID based on session token
@@ -718,6 +714,7 @@ func GetProfile(token string) ([]Profile, error) {
 	return userProfiles, nil
 }
 
+// Gets a singular user with their User ID
 func GetPerson(id int) (string, error) {
 
 	rows, err := DB.Query(`
@@ -800,6 +797,7 @@ func GetGateway(token string) ([]Gateway, error) {
 	return gatewayDatas, nil
 }
 
+// Gets all processes and its data for the user in a company thats connected to the process
 func GetProcess(token string) ([]Processes, error) {
 	//gets userID
 	userID, err := getUserIDFromToken(token)
@@ -846,6 +844,7 @@ func GetProcess(token string) ([]Processes, error) {
 	return ProcessesInfo, nil
 }
 
+// Gets all building in a company
 func GetBuilding(token string) ([]Building, error) {
 	//gets userID
 	userID, err := getUserIDFromToken(token)
@@ -891,6 +890,7 @@ func GetBuilding(token string) ([]Building, error) {
 	return BuildingInfos, nil
 }
 
+// make a session token for 24 hours
 func MakeSessionToken(email string) (string, error) {
 	tokenLength := 32
 
@@ -944,6 +944,7 @@ func isSessionTokenValid(sessionToken string) (bool, error) {
 	return exists, nil
 }
 
+// checks if the session token is still active or its expired
 func IsTokenStillActive(sessionToken string) (bool, error) {
 
 	var expires time.Time
@@ -955,6 +956,7 @@ func IsTokenStillActive(sessionToken string) (bool, error) {
 	return valid, nil
 }
 
+// deletes all session tokens that is expired before the time when this is run
 func ClearSessionTokens() {
 	_, err := DB.Exec("DELETE FROM session WHERE expires_at < ?", time.Now())
 	if err != nil {
@@ -963,6 +965,8 @@ func ClearSessionTokens() {
 	}
 	log.Println("Successfully cleared session tokens from database")
 }
+
+// Get process name with its ID
 func GetProcessNameById(id int) (string, error) {
 	var name = ""