Index: sources/app/src/main/java/parkup/configs/webConfigs/WebSecurityConfig.java
===================================================================
--- sources/app/src/main/java/parkup/configs/webConfigs/WebSecurityConfig.java	(revision 7bb19d480a279b6e8fcf5036af788b011b7db616)
+++ sources/app/src/main/java/parkup/configs/webConfigs/WebSecurityConfig.java	(revision bfc49f4f8c4656ca5fe6d689b0e5b438e4a7c993)
@@ -14,4 +14,5 @@
 import parkup.configs.CustomAuthorizationFilter;
 import parkup.services.AdministratorService;
+import parkup.services.GuestService;
 import parkup.services.RegisteredUserService;
 import parkup.services.WorkerService;
@@ -26,10 +27,12 @@
         private final RegisteredUserService registeredUserService;
         private final AdministratorService administratorService;
+        private final GuestService guestService;
 
-        public WebSecurityConfig(WorkerService workerService, BCryptPasswordEncoder bCryptPasswordEncoder, RegisteredUserService registeredUserService, AdministratorService administratorService) {
+        public WebSecurityConfig(WorkerService workerService, BCryptPasswordEncoder bCryptPasswordEncoder, RegisteredUserService registeredUserService, AdministratorService administratorService, GuestService guestService) {
             this.workerService = workerService;
             this.bCryptPasswordEncoder = bCryptPasswordEncoder;
             this.registeredUserService = registeredUserService;
             this.administratorService = administratorService;
+            this.guestService = guestService;
         }
 
@@ -39,5 +42,5 @@
             auth.userDetailsService(workerService).passwordEncoder(bCryptPasswordEncoder);
             auth.userDetailsService(administratorService).passwordEncoder(bCryptPasswordEncoder);
-
+            auth.userDetailsService(guestService).passwordEncoder(bCryptPasswordEncoder);
         }
 
Index: sources/app/src/main/java/parkup/controllers/ParkingSessionController.java
===================================================================
--- sources/app/src/main/java/parkup/controllers/ParkingSessionController.java	(revision 7bb19d480a279b6e8fcf5036af788b011b7db616)
+++ sources/app/src/main/java/parkup/controllers/ParkingSessionController.java	(revision bfc49f4f8c4656ca5fe6d689b0e5b438e4a7c993)
@@ -40,10 +40,10 @@
         return this.parkingSessionService.verifyParkingSession(parkingSessionId,parkingSpaceName);
     }
-    @GetMapping("/parkingSession/calculate/{parkingSessionId}")
-    public int calculateParkingSession(@PathVariable int parkingSessionId){
-        return this.parkingSessionService.calculatePayment(parkingSessionId);
+    @GetMapping("/parkingSession/calculate")
+    public int calculateParkingSession(){
+        return this.parkingSessionService.calculatePayment();
     }
     @PutMapping("/parkingSession/pay")
-    public boolean payParkingSession(@RequestParam String expireDate){
+    public boolean payParkingSession(@RequestParam(required = false) String expireDate){
         return this.parkingSessionService.payParkingSession(expireDate);
     }
Index: sources/app/src/main/java/parkup/services/GuestService.java
===================================================================
--- sources/app/src/main/java/parkup/services/GuestService.java	(revision 7bb19d480a279b6e8fcf5036af788b011b7db616)
+++ sources/app/src/main/java/parkup/services/GuestService.java	(revision bfc49f4f8c4656ca5fe6d689b0e5b438e4a7c993)
@@ -4,4 +4,7 @@
 import java.util.Optional;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.core.userdetails.UserDetails;
+import org.springframework.security.core.userdetails.UserDetailsService;
+import org.springframework.security.core.userdetails.UsernameNotFoundException;
 import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
 import org.springframework.stereotype.Service;
@@ -10,5 +13,5 @@
 
 @Service
-public class GuestService {
+public class GuestService implements UserDetailsService {
     private final GuestRepository guestRepository;
     private final BCryptPasswordEncoder passwordEncoder;
@@ -34,5 +37,6 @@
             throw new IllegalStateException("Email already taken, try adding a guest with a different valid email address");
         } else {
-//            guest.setPassword(passwordEncoder.encode(Math.random()));
+            double random = Math.random()*100;
+            guest.setPassword(passwordEncoder.encode(Double.toString(random)));
             this.guestRepository.save(guest);
         }
@@ -47,3 +51,10 @@
         }
     }
+
+    @Override
+    public UserDetails loadUserByUsername(String s) throws UsernameNotFoundException {
+        return guestRepository.findGuestByEmail(s)
+                .orElseThrow(() ->
+                        new UsernameNotFoundException("Email not found"));
+    }
 }
Index: sources/app/src/main/java/parkup/services/ParkingSessionService.java
===================================================================
--- sources/app/src/main/java/parkup/services/ParkingSessionService.java	(revision 7bb19d480a279b6e8fcf5036af788b011b7db616)
+++ sources/app/src/main/java/parkup/services/ParkingSessionService.java	(revision bfc49f4f8c4656ca5fe6d689b0e5b438e4a7c993)
@@ -93,18 +93,6 @@
 
     }
-
-//    public void executePayment(int id){
-//        ParkingSession session = parkingSessionRepository.findByPssId(id);
-//        if(session==null){
-//            throw new IllegalStateException("No such session exists");
-//        }
-//        else if(session.getStatus()== SessionStatus.ENDED_UNPAID){
-//            throw new IllegalStateException("Cannot execute payment on an ended session");
-//        }
-//        session.setStatus(SessionStatus.ENDED_PAID);
-//    }
-
-    public int calculatePayment(int id){
-        ParkingSession session = parkingSessionRepository.findByPssId(id);
+    public int calculatePayment(){
+        ParkingSession session = getParkingSession();
         if(session==null){
             throw new IllegalStateException("No such session exists");
@@ -182,4 +170,6 @@
         parkingSession.getParkingSpace().setTaken(false);
         registeredUserRepository.findAll().stream().filter(rp->rp.getSession().getStatus().equals(SessionStatus.ENDED_PAID)).forEach(rp->rp.setSession(null));
+        guestRepository.findAll().stream().filter(g->g.getSession().getStatus().equals(SessionStatus.ENDED_PAID)).forEach(g->g.setSession(null));
+        guestRepository.deleteAll(guestRepository.findAll().stream().filter(g-> g.getSession() == null).collect(Collectors.toList()));
         parkingSessionRepository.deleteByPssId(parkingSession.getPssId());
         return true;
