Index: sources/app/src/main/java/parkup/ParkUpApplication.java
===================================================================
--- sources/app/src/main/java/parkup/ParkUpApplication.java	(revision ce6ad22249e902dea17e6ba473846ccebdd4330c)
+++ sources/app/src/main/java/parkup/ParkUpApplication.java	(revision ce6ad22249e902dea17e6ba473846ccebdd4330c)
@@ -0,0 +1,14 @@
+package parkup;
+
+import org.springframework.boot.SpringApplication;
+import org.springframework.boot.autoconfigure.SpringBootApplication;
+
+@SpringBootApplication
+public class ParkUpApplication {
+    public ParkUpApplication() {
+    }
+
+    public static void main(String[] args) {
+        SpringApplication.run(ParkUpApplication.class, args);
+    }
+}
Index: sources/app/src/main/java/parkup/configs/PasswordEncoder.java
===================================================================
--- sources/app/src/main/java/parkup/configs/PasswordEncoder.java	(revision ce6ad22249e902dea17e6ba473846ccebdd4330c)
+++ sources/app/src/main/java/parkup/configs/PasswordEncoder.java	(revision ce6ad22249e902dea17e6ba473846ccebdd4330c)
@@ -0,0 +1,14 @@
+package parkup.configs;
+
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
+
+@Configuration
+public class PasswordEncoder {
+    @Bean
+    public BCryptPasswordEncoder bCryptPasswordEncoder(){
+        return new BCryptPasswordEncoder();
+    }
+
+}
Index: sources/app/src/main/java/parkup/configs/RegistrationController.java
===================================================================
--- sources/app/src/main/java/parkup/configs/RegistrationController.java	(revision ce6ad22249e902dea17e6ba473846ccebdd4330c)
+++ sources/app/src/main/java/parkup/configs/RegistrationController.java	(revision ce6ad22249e902dea17e6ba473846ccebdd4330c)
@@ -0,0 +1,23 @@
+//package parkup.configs;
+//
+//import org.springframework.web.bind.annotation.*;
+//
+//@RestController
+//public class RegistrationController {
+//
+//    private final RegistrationService registrationService;
+//
+//    public RegistrationController(RegistrationService registrationService) {
+//        this.registrationService = registrationService;
+//    }
+//
+//    @PostMapping(path = "/registration")
+//    public String register(@RequestBody RegistrationRequest request) {
+//        return registrationService.register(request);
+//    }
+//
+//    @GetMapping(path = "/registration/confirm")
+//    public String confirm(@RequestParam("token") String token) {
+//        return registrationService.confirmToken(token);
+//    }
+//}
Index: sources/app/src/main/java/parkup/configs/RegistrationRequest.java
===================================================================
--- sources/app/src/main/java/parkup/configs/RegistrationRequest.java	(revision ce6ad22249e902dea17e6ba473846ccebdd4330c)
+++ sources/app/src/main/java/parkup/configs/RegistrationRequest.java	(revision ce6ad22249e902dea17e6ba473846ccebdd4330c)
@@ -0,0 +1,32 @@
+package parkup.configs;
+
+public class RegistrationRequest {
+    private final String firstName;
+    private final String lastName;
+    private final String email;
+    private final String password;
+
+    public RegistrationRequest(String firstName, String lastName, String email, String password) {
+        this.firstName = firstName;
+        this.lastName = lastName;
+        this.email = email;
+        this.password = password;
+    }
+
+    public String getFirstName() {
+        return firstName;
+    }
+
+    public String getLastName() {
+        return lastName;
+    }
+
+    public String getEmail() {
+        return email;
+    }
+
+    public String getPassword() {
+        return password;
+    }
+
+}
Index: sources/app/src/main/java/parkup/configs/RegistrationService.java
===================================================================
--- sources/app/src/main/java/parkup/configs/RegistrationService.java	(revision ce6ad22249e902dea17e6ba473846ccebdd4330c)
+++ sources/app/src/main/java/parkup/configs/RegistrationService.java	(revision ce6ad22249e902dea17e6ba473846ccebdd4330c)
@@ -0,0 +1,147 @@
+package parkup.configs;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import parkup.configs.email.EmailSender;
+import parkup.configs.email.EmailValidator;
+import parkup.configs.token.ConfirmationToken;
+import parkup.configs.token.ConfirmationTokenService;
+import parkup.entities.Administrator;
+import parkup.services.AdministratorService;
+
+import javax.transaction.Transactional;
+import java.time.LocalDateTime;
+
+@Service
+public class RegistrationService {
+    private final AdministratorService administratorService;
+    private final EmailValidator emailValidator;
+    private final ConfirmationTokenService confirmationTokenService;
+    private final EmailSender emailSender;
+
+    @Autowired
+    public RegistrationService(AdministratorService administratorService, EmailValidator emailValidator,
+                               ConfirmationTokenService confirmationTokenService, EmailSender emailSender) {
+        this.administratorService = administratorService;
+        this.emailValidator = emailValidator;
+        this.confirmationTokenService = confirmationTokenService;
+        this.emailSender = emailSender;
+    }
+
+    public String register(RegistrationRequest request) {
+        boolean isValidEmail = emailValidator.
+                test(request.getEmail());
+
+        if (!isValidEmail) {
+            throw new IllegalStateException("email not valid");
+        }
+
+        String token = administratorService.signUpAdministrator(
+                new Administrator(
+                        request.getFirstName(),
+                        request.getLastName(),
+                        request.getEmail(),
+                        request.getPassword()
+                )
+        );
+
+        String link = "http://localhost:8080/administrator/registration/confirm?token=" + token;
+        emailSender.send(
+                request.getEmail(),
+                buildEmail(request.getFirstName(), link));
+
+        return token;
+    }
+
+    @Transactional
+    public String confirmToken(String token) {
+        ConfirmationToken confirmationToken = confirmationTokenService
+                .getToken(token)
+                .orElseThrow(() ->
+                        new IllegalStateException("token not found"));
+
+        if (confirmationToken.getConfirmedAt() != null) {
+            throw new IllegalStateException("email already confirmed");
+        }
+
+        LocalDateTime expiredAt = confirmationToken.getExpiresAt();
+
+        if (expiredAt.isBefore(LocalDateTime.now())) {
+            throw new IllegalStateException("token expired");
+        }
+
+        confirmationTokenService.setConfirmedAt(token);
+
+        administratorService.enableAdministrator(confirmationToken.getAdministrator().getEmail());
+        return "confirmed";
+    }
+
+    private String buildEmail(String name, String link) {
+        return "<div style=\"font-family:Helvetica,Arial,sans-serif;font-size:16px;margin:0;color:#0b0c0c\">\n" +
+                "\n" +
+                "<span style=\"display:none;font-size:1px;color:#fff;max-height:0\"></span>\n" +
+                "\n" +
+                "  <table role=\"presentation\" width=\"100%\" style=\"border-collapse:collapse;min-width:100%;width:100%!important\" cellpadding=\"0\" cellspacing=\"0\" border=\"0\">\n" +
+                "    <tbody><tr>\n" +
+                "      <td width=\"100%\" height=\"53\" bgcolor=\"#0b0c0c\">\n" +
+                "        \n" +
+                "        <table role=\"presentation\" width=\"100%\" style=\"border-collapse:collapse;max-width:580px\" cellpadding=\"0\" cellspacing=\"0\" border=\"0\" align=\"center\">\n" +
+                "          <tbody><tr>\n" +
+                "            <td width=\"70\" bgcolor=\"#0b0c0c\" valign=\"middle\">\n" +
+                "                <table role=\"presentation\" cellpadding=\"0\" cellspacing=\"0\" border=\"0\" style=\"border-collapse:collapse\">\n" +
+                "                  <tbody><tr>\n" +
+                "                    <td style=\"padding-left:10px\">\n" +
+                "                  \n" +
+                "                    </td>\n" +
+                "                    <td style=\"font-size:28px;line-height:1.315789474;Margin-top:4px;padding-left:10px\">\n" +
+                "                      <span style=\"font-family:Helvetica,Arial,sans-serif;font-weight:700;color:#ffffff;text-decoration:none;vertical-align:top;display:inline-block\">Confirm your email</span>\n" +
+                "                    </td>\n" +
+                "                  </tr>\n" +
+                "                </tbody></table>\n" +
+                "              </a>\n" +
+                "            </td>\n" +
+                "          </tr>\n" +
+                "        </tbody></table>\n" +
+                "        \n" +
+                "      </td>\n" +
+                "    </tr>\n" +
+                "  </tbody></table>\n" +
+                "  <table role=\"presentation\" class=\"m_-6186904992287805515content\" align=\"center\" cellpadding=\"0\" cellspacing=\"0\" border=\"0\" style=\"border-collapse:collapse;max-width:580px;width:100%!important\" width=\"100%\">\n" +
+                "    <tbody><tr>\n" +
+                "      <td width=\"10\" height=\"10\" valign=\"middle\"></td>\n" +
+                "      <td>\n" +
+                "        \n" +
+                "                <table role=\"presentation\" width=\"100%\" cellpadding=\"0\" cellspacing=\"0\" border=\"0\" style=\"border-collapse:collapse\">\n" +
+                "                  <tbody><tr>\n" +
+                "                    <td bgcolor=\"#1D70B8\" width=\"100%\" height=\"10\"></td>\n" +
+                "                  </tr>\n" +
+                "                </tbody></table>\n" +
+                "        \n" +
+                "      </td>\n" +
+                "      <td width=\"10\" valign=\"middle\" height=\"10\"></td>\n" +
+                "    </tr>\n" +
+                "  </tbody></table>\n" +
+                "\n" +
+                "\n" +
+                "\n" +
+                "  <table role=\"presentation\" class=\"m_-6186904992287805515content\" align=\"center\" cellpadding=\"0\" cellspacing=\"0\" border=\"0\" style=\"border-collapse:collapse;max-width:580px;width:100%!important\" width=\"100%\">\n" +
+                "    <tbody><tr>\n" +
+                "      <td height=\"30\"><br></td>\n" +
+                "    </tr>\n" +
+                "    <tr>\n" +
+                "      <td width=\"10\" valign=\"middle\"><br></td>\n" +
+                "      <td style=\"font-family:Helvetica,Arial,sans-serif;font-size:19px;line-height:1.315789474;max-width:560px\">\n" +
+                "        \n" +
+                "            <p style=\"Margin:0 0 20px 0;font-size:19px;line-height:25px;color:#0b0c0c\">Hi " + name + ",</p><p style=\"Margin:0 0 20px 0;font-size:19px;line-height:25px;color:#0b0c0c\"> Thank you for registering. Please click on the below link to activate your account: </p><blockquote style=\"Margin:0 0 20px 0;border-left:10px solid #b1b4b6;padding:15px 0 0.1px 15px;font-size:19px;line-height:25px\"><p style=\"Margin:0 0 20px 0;font-size:19px;line-height:25px;color:#0b0c0c\"> <a href=\"" + link + "\">Activate Now</a> </p></blockquote>\n Link will expire in 15 minutes. <p>See you soon</p>" +
+                "        \n" +
+                "      </td>\n" +
+                "      <td width=\"10\" valign=\"middle\"><br></td>\n" +
+                "    </tr>\n" +
+                "    <tr>\n" +
+                "      <td height=\"30\"><br></td>\n" +
+                "    </tr>\n" +
+                "  </tbody></table><div class=\"yj6qo\"></div><div class=\"adL\">\n" +
+                "\n" +
+                "</div></div>";
+    }
+}
Index: sources/app/src/main/java/parkup/configs/WebSecurityConfig.java
===================================================================
--- sources/app/src/main/java/parkup/configs/WebSecurityConfig.java	(revision ce6ad22249e902dea17e6ba473846ccebdd4330c)
+++ sources/app/src/main/java/parkup/configs/WebSecurityConfig.java	(revision ce6ad22249e902dea17e6ba473846ccebdd4330c)
@@ -0,0 +1,49 @@
+package parkup.configs;
+
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.security.authentication.dao.DaoAuthenticationProvider;
+import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder;
+import org.springframework.security.config.annotation.web.builders.HttpSecurity;
+import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
+import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;
+import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
+import parkup.services.AdministratorService;
+
+@Configuration
+@EnableWebSecurity
+public class WebSecurityConfig extends WebSecurityConfigurerAdapter {
+
+    private final AdministratorService administratorService;
+    private final BCryptPasswordEncoder bCryptPasswordEncoder;
+
+    public WebSecurityConfig(AdministratorService administratorService, BCryptPasswordEncoder bCryptPasswordEncoder) {
+        this.bCryptPasswordEncoder = bCryptPasswordEncoder;
+        this.administratorService = administratorService;
+    }
+
+    @Override
+    protected void configure(HttpSecurity http) throws Exception {
+        http
+                .csrf().disable()
+                .authorizeRequests()
+                    .antMatchers("/administrator/registration/**")
+                    .permitAll()
+                .anyRequest()
+                .authenticated().and()
+                .formLogin();
+    }
+
+    @Override
+    protected void configure(AuthenticationManagerBuilder auth) throws Exception {
+        auth.authenticationProvider(daoAuthenticationProvider());
+    }
+
+    @Bean
+    public DaoAuthenticationProvider daoAuthenticationProvider(){
+        DaoAuthenticationProvider provider = new DaoAuthenticationProvider();
+        provider.setPasswordEncoder(bCryptPasswordEncoder);
+        provider.setUserDetailsService(administratorService);
+        return provider;
+    }
+}
Index: sources/app/src/main/java/parkup/configs/email/EmailSender.java
===================================================================
--- sources/app/src/main/java/parkup/configs/email/EmailSender.java	(revision ce6ad22249e902dea17e6ba473846ccebdd4330c)
+++ sources/app/src/main/java/parkup/configs/email/EmailSender.java	(revision ce6ad22249e902dea17e6ba473846ccebdd4330c)
@@ -0,0 +1,5 @@
+package parkup.configs.email;
+
+public interface EmailSender {
+    void send(String to, String email);
+}
Index: sources/app/src/main/java/parkup/configs/email/EmailService.java
===================================================================
--- sources/app/src/main/java/parkup/configs/email/EmailService.java	(revision ce6ad22249e902dea17e6ba473846ccebdd4330c)
+++ sources/app/src/main/java/parkup/configs/email/EmailService.java	(revision ce6ad22249e902dea17e6ba473846ccebdd4330c)
@@ -0,0 +1,41 @@
+package parkup.configs.email;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.mail.javamail.JavaMailSender;
+import org.springframework.mail.javamail.MimeMessageHelper;
+import org.springframework.scheduling.annotation.Async;
+import org.springframework.stereotype.Service;
+
+import javax.mail.MessagingException;
+import javax.mail.internet.MimeMessage;
+
+@Service
+public class EmailService implements EmailSender{
+
+    private final static Logger LOGGER = LoggerFactory.getLogger(EmailService.class);
+    private final JavaMailSender mailSender;
+
+    public EmailService(JavaMailSender mailSender) {
+        this.mailSender = mailSender;
+    }
+
+    @Override
+    @Async
+    public void send(String to, String email) {
+        try {
+            MimeMessage mimeMessage = mailSender.createMimeMessage();
+            MimeMessageHelper helper =
+                    new MimeMessageHelper(mimeMessage, "utf-8");
+            helper.setText(email, true);
+            helper.setTo(to);
+            helper.setSubject("Confirm your email");
+            helper.setFrom("parkup@gmail.com");
+            mailSender.send(mimeMessage);
+        } catch (MessagingException e) {
+            LOGGER.error("failed to send email", e);
+            throw new IllegalStateException("failed to send email");
+        }
+    }
+}
+
Index: sources/app/src/main/java/parkup/configs/email/EmailValidator.java
===================================================================
--- sources/app/src/main/java/parkup/configs/email/EmailValidator.java	(revision ce6ad22249e902dea17e6ba473846ccebdd4330c)
+++ sources/app/src/main/java/parkup/configs/email/EmailValidator.java	(revision ce6ad22249e902dea17e6ba473846ccebdd4330c)
@@ -0,0 +1,14 @@
+package parkup.configs.email;
+
+import org.springframework.stereotype.Service;
+
+import java.util.function.Predicate;
+
+@Service
+public class EmailValidator implements Predicate<String> {
+    @Override
+    public boolean test(String s) {
+        //todo
+        return true;
+    }
+}
Index: sources/app/src/main/java/parkup/configs/token/ConfirmationToken.java
===================================================================
--- sources/app/src/main/java/parkup/configs/token/ConfirmationToken.java	(revision ce6ad22249e902dea17e6ba473846ccebdd4330c)
+++ sources/app/src/main/java/parkup/configs/token/ConfirmationToken.java	(revision ce6ad22249e902dea17e6ba473846ccebdd4330c)
@@ -0,0 +1,105 @@
+package parkup.configs.token;
+
+import parkup.entities.Administrator;
+
+import javax.persistence.*;
+import java.time.LocalDateTime;
+
+@Entity
+public class ConfirmationToken {
+
+    @Id
+    @Column(name = "confirmation_token_id")
+    @SequenceGenerator(
+            name="confirmation_token_generator",
+            sequenceName = "confirmation_token_sequence",
+            allocationSize = 1,
+            initialValue = 900
+    )
+    @GeneratedValue(    //za postgres treba sequence da se namesti i ime na generator mi ga davamo kako od gore sto e
+            strategy = GenerationType.SEQUENCE,
+            generator = "confirmation_token_sequence_generator"
+    )
+    private int id;
+
+    @Column(nullable = false)
+    private String token;
+
+    @Column(nullable = false)
+    private LocalDateTime createdAt;
+
+    @Column(nullable = false)
+    private LocalDateTime expiresAt;
+
+    private LocalDateTime confirmedAt;
+
+    @ManyToOne
+    @JoinColumn(nullable = false, name = "administrator_id")
+    //many confirmation tokens to one administrator
+    private Administrator administrator;
+
+    public ConfirmationToken() {}
+
+    public ConfirmationToken(int id, String token, LocalDateTime createdAt, LocalDateTime expiresAt, Administrator administrator) {
+        this.id = id;
+        this.token = token;
+        this.createdAt = createdAt;
+        this.expiresAt = expiresAt;
+        this.administrator = administrator;
+    }
+
+    public ConfirmationToken(String token, LocalDateTime createdAt, LocalDateTime expiresAt, Administrator administrator) {
+        this.token = token;
+        this.createdAt = createdAt;
+        this.expiresAt = expiresAt;
+        this.administrator = administrator;
+    }
+
+    public int getId() {
+        return id;
+    }
+
+    public void setId(int id) {
+        this.id = id;
+    }
+
+    public String getToken() {
+        return token;
+    }
+
+    public void setToken(String token) {
+        this.token = token;
+    }
+
+    public LocalDateTime getCreatedAt() {
+        return createdAt;
+    }
+
+    public void setCreatedAt(LocalDateTime createdAt) {
+        this.createdAt = createdAt;
+    }
+
+    public LocalDateTime getExpiresAt() {
+        return expiresAt;
+    }
+
+    public void setExpiresAt(LocalDateTime expiresAt) {
+        this.expiresAt = expiresAt;
+    }
+
+    public LocalDateTime getConfirmedAt() {
+        return confirmedAt;
+    }
+
+    public void setConfirmedAt(LocalDateTime confirmedAt) {
+        this.confirmedAt = confirmedAt;
+    }
+
+    public Administrator getAdministrator() {
+        return administrator;
+    }
+
+    public void setAdministrator(Administrator administrator) {
+        this.administrator = administrator;
+    }
+}
Index: sources/app/src/main/java/parkup/configs/token/ConfirmationTokenRepository.java
===================================================================
--- sources/app/src/main/java/parkup/configs/token/ConfirmationTokenRepository.java	(revision ce6ad22249e902dea17e6ba473846ccebdd4330c)
+++ sources/app/src/main/java/parkup/configs/token/ConfirmationTokenRepository.java	(revision ce6ad22249e902dea17e6ba473846ccebdd4330c)
@@ -0,0 +1,23 @@
+package parkup.configs.token;
+
+import org.springframework.data.jpa.repository.JpaRepository;
+import org.springframework.data.jpa.repository.Modifying;
+import org.springframework.data.jpa.repository.Query;
+import org.springframework.stereotype.Repository;
+
+import javax.transaction.Transactional;
+import java.time.LocalDateTime;
+import java.util.Optional;
+
+@Repository
+public interface ConfirmationTokenRepository extends JpaRepository<ConfirmationToken,Integer> {
+
+    Optional<ConfirmationToken> findByToken(String token);
+
+    @Transactional
+    @Modifying
+    @Query("UPDATE ConfirmationToken c " +
+            "SET c.confirmedAt = ?2 " +
+            "WHERE c.token = ?1")
+    int updateConfirmedAt(String token, LocalDateTime confirmedAt);
+}
Index: sources/app/src/main/java/parkup/configs/token/ConfirmationTokenService.java
===================================================================
--- sources/app/src/main/java/parkup/configs/token/ConfirmationTokenService.java	(revision ce6ad22249e902dea17e6ba473846ccebdd4330c)
+++ sources/app/src/main/java/parkup/configs/token/ConfirmationTokenService.java	(revision ce6ad22249e902dea17e6ba473846ccebdd4330c)
@@ -0,0 +1,28 @@
+package parkup.configs.token;
+
+import org.springframework.stereotype.Service;
+
+import java.time.LocalDateTime;
+import java.util.Optional;
+
+@Service
+public class ConfirmationTokenService {
+
+    private final ConfirmationTokenRepository confirmationTokenRepository;
+
+    public ConfirmationTokenService(ConfirmationTokenRepository confirmationTokenRepository) {
+        this.confirmationTokenRepository = confirmationTokenRepository;
+    }
+
+    public void saveConfirmationToken(ConfirmationToken token){
+        confirmationTokenRepository.save(token);
+    }
+
+    public Optional<ConfirmationToken> getToken(String token) {
+        return confirmationTokenRepository.findByToken(token);
+    }
+
+    public int setConfirmedAt(String token) {
+        return confirmationTokenRepository.updateConfirmedAt(token, LocalDateTime.now());
+    }
+}
Index: sources/app/src/main/java/parkup/controllers/AdministratorController.java
===================================================================
--- sources/app/src/main/java/parkup/controllers/AdministratorController.java	(revision ce6ad22249e902dea17e6ba473846ccebdd4330c)
+++ sources/app/src/main/java/parkup/controllers/AdministratorController.java	(revision ce6ad22249e902dea17e6ba473846ccebdd4330c)
@@ -0,0 +1,61 @@
+package parkup.controllers;
+
+import java.util.List;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+import parkup.configs.RegistrationRequest;
+import parkup.configs.RegistrationService;
+import parkup.entities.Administrator;
+import parkup.services.AdministratorService;
+
+@RestController
+public class AdministratorController {
+    private final AdministratorService administratorService;
+    private final RegistrationService registrationService;
+
+    @Autowired
+    public AdministratorController(AdministratorService administratorService, RegistrationService registrationService) {
+        this.administratorService = administratorService;
+        this.registrationService = registrationService;
+    }
+
+    @GetMapping({"/administrator"})
+    public List<Administrator> getAllAdministrator() {
+        return this.administratorService.getAllAdministrators();
+    }
+
+    @GetMapping({"/administrator/{administratorId}"})
+    public Administrator getAdministrator(@PathVariable int administratorId) {
+        Administrator administrator = this.administratorService.findById(administratorId);
+        if (administrator != null) {
+            return administrator;
+        } else {
+            throw new RuntimeException("Administrator not found");
+        }
+    }
+
+    @PostMapping({"/administrator"})
+    public void addAdministrator(@RequestBody Administrator administrator) {
+        this.administratorService.addAdministrator(administrator);
+    }
+
+    @PutMapping({"/administrator/{administratorId}"})
+    public void updateAdministrator(@PathVariable int administratorId, @RequestBody Administrator administrator) {
+        this.administratorService.updateAdministrator(administratorId, administrator.getFirstName(), administrator.getLastName(), administrator.getMobile(), administrator.getEmail());
+    }
+
+    @DeleteMapping({"/administrator/{administratorId}"})
+    public void deleteAdministrator(@PathVariable int administratorId) {
+        this.administratorService.deleteAdministrator(administratorId);
+    }
+
+    @PostMapping({"/administrator/registration"})
+    public String register(@RequestBody RegistrationRequest request){
+        return registrationService.register(request);
+    }
+
+    @GetMapping(path = "/administrator/registration/confirm")
+    public String confirm(@RequestParam("token") String token) {
+        return registrationService.confirmToken(token);
+    }
+}
Index: sources/app/src/main/java/parkup/controllers/GuestController.java
===================================================================
--- sources/app/src/main/java/parkup/controllers/GuestController.java	(revision ce6ad22249e902dea17e6ba473846ccebdd4330c)
+++ sources/app/src/main/java/parkup/controllers/GuestController.java	(revision ce6ad22249e902dea17e6ba473846ccebdd4330c)
@@ -0,0 +1,48 @@
+package parkup.controllers;
+
+import java.util.List;
+import java.util.UUID;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.DeleteMapping;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RestController;
+import parkup.entities.Guest;
+import parkup.services.GuestService;
+
+@RestController
+public class GuestController {
+    private final GuestService guestService;
+
+    @Autowired
+    public GuestController(GuestService guestService) {
+        this.guestService = guestService;
+    }
+
+    @GetMapping({"/guest"})
+    public List<Guest> getAllGuest() {
+        return this.guestService.getGuests();
+    }
+
+    @GetMapping({"/guest/{guestId}"})
+    public Guest getGuest(@PathVariable int guestId) {
+        Guest guest = this.guestService.findById(guestId);
+        if (guest != null) {
+            return guest;
+        } else {
+            throw new RuntimeException("Guest not found");
+        }
+    }
+
+    @PostMapping({"/guest"})
+    public void addGuest(@RequestBody Guest guest) {
+        this.guestService.addGuest(guest);
+    }
+
+    @DeleteMapping({"/guest/{guestId}"})
+    public void deleteGuest(@PathVariable int guestId) {
+        this.guestService.deleteGuest(guestId);
+    }
+}
Index: sources/app/src/main/java/parkup/controllers/ParkingSessionController.java
===================================================================
--- sources/app/src/main/java/parkup/controllers/ParkingSessionController.java	(revision ce6ad22249e902dea17e6ba473846ccebdd4330c)
+++ sources/app/src/main/java/parkup/controllers/ParkingSessionController.java	(revision ce6ad22249e902dea17e6ba473846ccebdd4330c)
@@ -0,0 +1,49 @@
+package parkup.controllers;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+import parkup.entities.ParkingSession;
+import parkup.services.ParkingSessionService;
+
+import java.util.List;
+
+@RestController
+public class ParkingSessionController {
+    private final ParkingSessionService parkingSessionService;
+
+    @Autowired
+    public ParkingSessionController(ParkingSessionService parkingSessionService) {
+        this.parkingSessionService = parkingSessionService;
+    }
+
+    @GetMapping({"/parkingSession"})
+    public List<ParkingSession> getAllParkingSessions() {
+        return parkingSessionService.getAllParkingSessions();
+    }
+
+    @GetMapping({"/parkingSession/{parkingSessionId}"})
+    public ParkingSession getParkingSession(@PathVariable int parkingSessionId) {
+        ParkingSession parkingSession = parkingSessionService.findById(parkingSessionId);
+        if (parkingSession != null) {
+            return parkingSession;
+        } else {
+            throw new RuntimeException("ParkingSession not found");
+        }
+    }
+
+    @PostMapping({"/parkingSession"})
+    public void addParkingSession(@RequestBody ParkingSession parkingSession) {
+        //System.out.println("???????");
+        parkingSessionService.addParkingSession(parkingSession);
+    }
+
+    @PutMapping({"/parkingSession/{parkingSessionId}"})
+    public void updateParkingSession(@PathVariable int parkingSessionId, @RequestBody ParkingSession parkingSession) {
+        parkingSessionService.updateParkingSession(parkingSessionId, parkingSession.getTimeStart(), parkingSession.getTimeEnd());
+    }
+
+    @DeleteMapping({"/parkingSession/{parkingSessionId}"})
+    public void deleteParkingSession(@PathVariable int parkingSessionId) {
+        parkingSessionService.deleteParkingSession(parkingSessionId);
+    }
+}
Index: sources/app/src/main/java/parkup/controllers/ParkingSpaceController.java
===================================================================
--- sources/app/src/main/java/parkup/controllers/ParkingSpaceController.java	(revision ce6ad22249e902dea17e6ba473846ccebdd4330c)
+++ sources/app/src/main/java/parkup/controllers/ParkingSpaceController.java	(revision ce6ad22249e902dea17e6ba473846ccebdd4330c)
@@ -0,0 +1,49 @@
+package parkup.controllers;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+import parkup.entities.ParkingSpace;
+import parkup.services.ParkingSpaceService;
+
+import java.util.List;
+
+@RestController
+public class ParkingSpaceController {
+    private final ParkingSpaceService parkingSpaceService;
+
+    @Autowired
+    public ParkingSpaceController(ParkingSpaceService parkingSpaceService) {
+        this.parkingSpaceService = parkingSpaceService;
+    }
+
+    @GetMapping({"/parkingSpace"})
+    public List<ParkingSpace> getAllParkingSpaces() {
+        return parkingSpaceService.getAllParkingSpaces();
+    }
+
+    @GetMapping({"/parkingSpace/{parkingSpaceId}"})
+    public ParkingSpace getParkingSpace(@PathVariable int parkingSpaceId) {
+        ParkingSpace parkingSpace = parkingSpaceService.findById(parkingSpaceId);
+        if (parkingSpace != null) {
+            return parkingSpace;
+        } else {
+            throw new RuntimeException("ParkingSpace not found");
+        }
+    }
+
+    @PostMapping({"/parkingSpace"})
+    public void addParkingSpace(@RequestBody ParkingSpace parkingSpace) {
+        //System.out.println("???????");
+        parkingSpaceService.addParkingSpace(parkingSpace);
+    }
+
+    @PutMapping({"/parkingSpace/{parkingSpaceId}"})
+    public void updateParkingSpace(@PathVariable int parkingSpaceId, @RequestBody ParkingSpace parkingSpace) {
+        parkingSpaceService.updateParkingSpace(parkingSpaceId, parkingSpace.getPsName(), parkingSpace.isTaken(), parkingSpace.isHandicaped());
+    }
+
+    @DeleteMapping({"/parkingSpace/{parkingSpaceId}"})
+    public void deleteParkingSpace(@PathVariable int parkingSpaceId) {
+        parkingSpaceService.deleteParkingSpace(parkingSpaceId);
+    }
+}
Index: sources/app/src/main/java/parkup/controllers/ParkingZoneController.java
===================================================================
--- sources/app/src/main/java/parkup/controllers/ParkingZoneController.java	(revision ce6ad22249e902dea17e6ba473846ccebdd4330c)
+++ sources/app/src/main/java/parkup/controllers/ParkingZoneController.java	(revision ce6ad22249e902dea17e6ba473846ccebdd4330c)
@@ -0,0 +1,49 @@
+package parkup.controllers;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+import parkup.entities.ParkingZone;
+import parkup.services.ParkingZoneService;
+
+import java.util.List;
+
+@RestController
+public class ParkingZoneController {
+    private final ParkingZoneService parkingZoneService;
+
+    @Autowired
+    public ParkingZoneController(ParkingZoneService parkingZoneService) {
+        this.parkingZoneService = parkingZoneService;
+    }
+
+    @GetMapping({"/parkingZone"})
+    public List<ParkingZone> getAllParkingZone() {
+        return parkingZoneService.getAllParkingZones();
+    }
+
+    @GetMapping({"/parkingZone/{parkingZoneId}"})
+    public ParkingZone getParkingZone(@PathVariable int parkingZoneId) {
+        ParkingZone parkingZone = parkingZoneService.findById(parkingZoneId);
+        if (parkingZone != null) {
+            return parkingZone;
+        } else {
+            throw new RuntimeException("ParkingZone not found");
+        }
+    }
+
+    @PostMapping({"/parkingZone"})
+    public void addParkingZone(@RequestBody ParkingZone parkingZone) {
+        //System.out.println("???????");
+        parkingZoneService.addParkingZone(parkingZone);
+    }
+
+    @PutMapping({"/parkingZone/{parkingZoneId}"})
+    public void updateParkingZone(@PathVariable int parkingZoneId, @RequestBody ParkingZone parkingZone) {
+        parkingZoneService.updateParkingZone(parkingZoneId, parkingZone.getPzName(), parkingZone.getPrice(), parkingZone.getCapacity(), parkingZone.getWorkHours(),parkingZone.getLocation());
+    }
+
+    @DeleteMapping({"/parkingZone/{parkingZoneId}"})
+    public void deleteParkingZone(@PathVariable int parkingZoneId) {
+        parkingZoneService.deleteParkingZone(parkingZoneId);
+    }
+}
Index: sources/app/src/main/java/parkup/controllers/RegistriranParkiracController.java
===================================================================
--- sources/app/src/main/java/parkup/controllers/RegistriranParkiracController.java	(revision ce6ad22249e902dea17e6ba473846ccebdd4330c)
+++ sources/app/src/main/java/parkup/controllers/RegistriranParkiracController.java	(revision ce6ad22249e902dea17e6ba473846ccebdd4330c)
@@ -0,0 +1,53 @@
+package parkup.controllers;
+
+import java.util.List;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.DeleteMapping;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.PutMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RestController;
+import parkup.entities.RegistriranParkirac;
+import parkup.services.RegistriranParkiracService;
+
+@RestController
+public class RegistriranParkiracController {
+    private final RegistriranParkiracService registriranParkiracService;
+
+    @Autowired
+    public RegistriranParkiracController(RegistriranParkiracService registriranParkiracService) {
+        this.registriranParkiracService = registriranParkiracService;
+    }
+
+    @GetMapping({"/registriranParkirac"})
+    public List<RegistriranParkirac> getAllRegistriraniParkiraci() {
+        return this.registriranParkiracService.getRegPark();
+    }
+
+    @GetMapping({"/registriranParkirac/{regParkId}"})
+    public RegistriranParkirac getRegistriranParkirac(@PathVariable int regParkId) {
+        RegistriranParkirac regPark = this.registriranParkiracService.findById(regParkId);
+        if (regPark != null) {
+            return regPark;
+        } else {
+            throw new RuntimeException("User not found");
+        }
+    }
+
+    @PostMapping({"/registriranParkirac"})
+    public void addRegistriranParkirac(@RequestBody RegistriranParkirac regPark) {
+        this.registriranParkiracService.addRegPark(regPark);
+    }
+
+    @PutMapping({"/registriranParkirac/{regParkId}"})
+    public void updateRegistriranParkirac(@PathVariable int regParkId, @RequestBody RegistriranParkirac regPark) {
+        this.registriranParkiracService.updateRegPark(regParkId, regPark.getName(), regPark.getSurname(), regPark.getMobile(), regPark.getEmail());
+    }
+
+    @DeleteMapping({"/registriranParkirac/{regParkId}"})
+    public void deleteRegistriranParkirac(@PathVariable int regParkId) {
+        this.registriranParkiracService.deleteRegPark(regParkId);
+    }
+}
Index: sources/app/src/main/java/parkup/controllers/VrabotenController.java
===================================================================
--- sources/app/src/main/java/parkup/controllers/VrabotenController.java	(revision ce6ad22249e902dea17e6ba473846ccebdd4330c)
+++ sources/app/src/main/java/parkup/controllers/VrabotenController.java	(revision ce6ad22249e902dea17e6ba473846ccebdd4330c)
@@ -0,0 +1,53 @@
+package parkup.controllers;
+
+import java.util.List;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.DeleteMapping;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.PutMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RestController;
+import parkup.entities.Vraboten;
+import parkup.services.VrabotenService;
+
+@RestController
+public class VrabotenController {
+    private final VrabotenService vrabotenService;
+
+    @Autowired
+    public VrabotenController(VrabotenService vrabotenService) {
+        this.vrabotenService = vrabotenService;
+    }
+
+    @GetMapping({"/vraboten"})
+    public List<Vraboten> getAllVraboten() {
+        return this.vrabotenService.getVraboteni();
+    }
+
+    @GetMapping({"/vraboten/{vrabotenId}"})
+    public Vraboten getVraboten(@PathVariable int vrabotenId) {
+        Vraboten vraboten = this.vrabotenService.findById(vrabotenId);
+        if (vraboten != null) {
+            return vraboten;
+        } else {
+            throw new RuntimeException("Vraboten not found");
+        }
+    }
+
+    @PostMapping({"/vraboten"})
+    public void addVraboten(@RequestBody Vraboten vraboten) {
+        this.vrabotenService.addVraboten(vraboten);
+    }
+
+    @PutMapping({"/vraboten/{vrabotenId}"})
+    public void updateVraboten(@PathVariable int vrabotenId, @RequestBody Vraboten vraboten) {
+        this.vrabotenService.updateVraboten(vrabotenId, vraboten.getFirstName(), vraboten.getLastName(), vraboten.getMobile(), vraboten.getEmail());
+    }
+
+    @DeleteMapping({"/vraboten/{vrabotenId}"})
+    public void deleteVraboten(@PathVariable int vrabotenId) {
+        this.vrabotenService.deleteVraboten(vrabotenId);
+    }
+}
Index: sources/app/src/main/java/parkup/data/Tablicka.java
===================================================================
--- sources/app/src/main/java/parkup/data/Tablicka.java	(revision ce6ad22249e902dea17e6ba473846ccebdd4330c)
+++ sources/app/src/main/java/parkup/data/Tablicka.java	(revision ce6ad22249e902dea17e6ba473846ccebdd4330c)
@@ -0,0 +1,25 @@
+package parkup.data;
+
+import javax.persistence.Entity;
+import javax.persistence.Id;
+
+@Entity
+public class Tablicka {
+    @Id
+    private int tablicaId;
+    private String tablica;
+
+    public Tablicka() {}
+
+    public Tablicka(String tablica) {
+        this.tablica = tablica;
+    }
+
+    public String getTablica() {
+        return this.tablica;
+    }
+
+    public void setTablica(String tablica) {
+        this.tablica = tablica;
+    }
+}
Index: sources/app/src/main/java/parkup/entities/Administrator.java
===================================================================
--- sources/app/src/main/java/parkup/entities/Administrator.java	(revision ce6ad22249e902dea17e6ba473846ccebdd4330c)
+++ sources/app/src/main/java/parkup/entities/Administrator.java	(revision ce6ad22249e902dea17e6ba473846ccebdd4330c)
@@ -0,0 +1,165 @@
+package parkup.entities;
+
+import org.springframework.security.core.GrantedAuthority;
+import org.springframework.security.core.authority.SimpleGrantedAuthority;
+import org.springframework.security.core.userdetails.UserDetails;
+
+import javax.persistence.*;
+import java.util.Collection;
+import java.util.Collections;
+
+@Entity
+@Table(name = "administrator")
+public class Administrator implements UserDetails {
+    @Id
+    @SequenceGenerator(
+            name="administrator_sequence_generator",
+            sequenceName = "administrator_sequence",
+            allocationSize = 1,
+            initialValue = 100
+    )
+    @GeneratedValue(    //za postgres treba sequence da se namesti i ime na generator mi ga davamo kako od gore sto e
+            strategy = GenerationType.SEQUENCE,
+            generator = "administrator_sequence_generator"
+    )
+    @Column(name = "administratorId")
+    private int administratorId;
+
+    @Column(name = "firstName")
+    private String firstName;
+
+    @Column(name = "lastName")
+    private String lastName;
+
+    @Column(name = "email")
+    private String email;
+
+    @Column(name = "password")
+    private String password;
+
+    @Column(name = "mobile")
+    private String mobile;
+
+    @Column(name = "role")
+    private String role;
+
+    private boolean locked;
+
+    private boolean enabled;
+
+    public Administrator(){
+        this.role = "ROLE_ADMINISTRATOR";
+    }
+
+    public Administrator(int administratorId, String firstName, String lastName, String email, String password, String mobile) {
+        this.administratorId = administratorId;
+        this.firstName = firstName;
+        this.lastName = lastName;
+        this.email = email;
+        this.password = password;
+        this.mobile = mobile;
+        this.role = "ROLE_ADMINISTRATOR";
+    }
+
+    public Administrator(String firstName, String lastName, String email, String password, String mobile) {
+        this.firstName = firstName;
+        this.lastName = lastName;
+        this.email = email;
+        this.password = password;
+        this.mobile = mobile;
+        this.role = "ROLE_ADMINISTRATOR";
+    }
+
+    public Administrator(String firstName, String lastName, String email, String password) {
+        this.firstName = firstName;
+        this.lastName = lastName;
+        this.email = email;
+        this.password = password;
+        this.mobile = mobile;
+        this.role = "ROLE_ADMINISTRATOR";
+    }
+
+    public int getAdministratorId() {
+        return administratorId;
+    }
+
+    public void setAdministratorId(int administratorId) {
+        this.administratorId = administratorId;
+    }
+
+    public String getFirstName() {
+        return firstName;
+    }
+
+    public void setFirstName(String firstName) {
+        this.firstName = firstName;
+    }
+
+    public String getLastName() {
+        return lastName;
+    }
+
+    public void setLastName(String lastName) {
+        this.lastName = lastName;
+    }
+
+    public String getEmail() {
+        return email;
+    }
+
+    public void setEmail(String email) {
+        this.email = email;
+    }
+
+    public void setPassword(String password) {
+        this.password = password;
+    }
+
+    public String getMobile() {
+        return mobile;
+    }
+
+    public void setMobile(String mobile) {
+        this.mobile = mobile;
+    }
+
+    public String getRole() {return role;}
+
+    public void setRole(String role) {this.role = role;}
+
+    @Override
+    public Collection<? extends GrantedAuthority> getAuthorities() {
+        SimpleGrantedAuthority authority = new SimpleGrantedAuthority(role);
+        return Collections.singleton(authority);
+    }
+
+    @Override
+    public String getPassword() {
+        return password;
+    }
+
+    @Override
+    public String getUsername() {
+        return email;
+    }
+
+    @Override
+    public boolean isAccountNonExpired() {
+        return true;
+    }
+
+    @Override
+    public boolean isAccountNonLocked() {
+        return !locked;
+    }
+
+    @Override
+    public boolean isCredentialsNonExpired() {
+        return true;
+    }
+
+    @Override
+    public boolean isEnabled() {
+        return enabled;
+    }
+}
Index: sources/app/src/main/java/parkup/entities/Guest.java
===================================================================
--- sources/app/src/main/java/parkup/entities/Guest.java	(revision ce6ad22249e902dea17e6ba473846ccebdd4330c)
+++ sources/app/src/main/java/parkup/entities/Guest.java	(revision ce6ad22249e902dea17e6ba473846ccebdd4330c)
@@ -0,0 +1,81 @@
+package parkup.entities;
+
+import javax.persistence.*;
+
+import parkup.data.Tablicka;
+
+@Entity
+@Table(name = "guest")
+public class Guest {
+    @Id
+    @SequenceGenerator(
+            name="guest_sequence_generator",
+            sequenceName = "guest_sequence",
+            allocationSize = 1,
+            initialValue = 400
+    )
+    @GeneratedValue(    //za postgres treba sequence da se namesti i ime na generator mi ga davamo kako od gore sto e
+            strategy = GenerationType.SEQUENCE,
+            generator = "guest_sequence_generator"
+    )
+    @Column(name = "guestId")
+    private int guestId;
+
+    //dali ova treba vaka?
+    @OneToOne
+    @JoinColumn(name = "tablickaId", nullable = false)
+    private Tablicka tablicka;
+
+    @Column(name = "email")
+    private String email;
+
+    @Column(name = "mobile")
+    private String mobile;
+
+    public Guest() {}
+
+    public Guest(int guestId, Tablicka tablicka, String email, String mobile) {
+        this.guestId = guestId;
+        this.tablicka = tablicka;
+        this.email = email;
+        this.mobile = mobile;
+    }
+
+    public Guest(Tablicka tablicka, String email, String mobile) {
+        this.tablicka = tablicka;
+        this.email = email;
+        this.mobile = mobile;
+    }
+
+    public int getGuestId() {
+        return guestId;
+    }
+
+    public void setGuestId(int guestId) {
+        this.guestId = guestId;
+    }
+
+    public Tablicka getTablicka() {
+        return tablicka;
+    }
+
+    public void setTablicka(Tablicka tablicka) {
+        this.tablicka = tablicka;
+    }
+
+    public String getEmail() {
+        return email;
+    }
+
+    public void setEmail(String email) {
+        this.email = email;
+    }
+
+    public String getMobile() {
+        return mobile;
+    }
+
+    public void setMobile(String mobile) {
+        this.mobile = mobile;
+    }
+}
Index: sources/app/src/main/java/parkup/entities/ParkingSession.java
===================================================================
--- sources/app/src/main/java/parkup/entities/ParkingSession.java	(revision ce6ad22249e902dea17e6ba473846ccebdd4330c)
+++ sources/app/src/main/java/parkup/entities/ParkingSession.java	(revision ce6ad22249e902dea17e6ba473846ccebdd4330c)
@@ -0,0 +1,64 @@
+package parkup.entities;
+
+import javax.persistence.*;
+
+@Entity
+@Table(name = "parking_session")
+public class ParkingSession {
+    @Id
+    @Column(name = "parking_session_id")
+    @SequenceGenerator(
+            name="parking_session_generator",
+            sequenceName = "parking_session_sequence",
+            allocationSize = 1,
+            initialValue = 700
+    )
+    @GeneratedValue(    //za postgres treba sequence da se namesti i ime na generator mi ga davamo kako od gore sto e
+            strategy = GenerationType.SEQUENCE,
+            generator = "parking_session_sequence_generator"
+    )
+    private int pssId;
+
+    @Column(name = "time_start")
+    private String timeStart;
+
+    @Column(name = "time_end")
+    private String timeEnd;
+
+    public ParkingSession() {}
+
+    public ParkingSession(int pssId, String timeStart, String timeEnd) {
+        this.pssId = pssId;
+        this.timeStart = timeStart;
+        this.timeEnd = timeEnd;
+    }
+
+    public ParkingSession(String timeStart, String timeEnd) {
+        this.timeStart = timeStart;
+        this.timeEnd = timeEnd;
+    }
+
+    public int getPssId() {
+        return this.pssId;
+    }
+
+    public void setPssId(int pssId) {
+        this.pssId = pssId;
+    }
+
+    public String getTimeStart() {
+        return this.timeStart;
+    }
+
+    public void setTimeStart(String timeStart) {
+        this.timeStart = timeStart;
+    }
+
+    public String getTimeEnd() {
+        return this.timeEnd;
+    }
+
+    public void setTimeEnd(String timeEnd) {
+        this.timeEnd = timeEnd;
+    }
+}
Index: sources/app/src/main/java/parkup/entities/ParkingSpace.java
===================================================================
--- sources/app/src/main/java/parkup/entities/ParkingSpace.java	(revision ce6ad22249e902dea17e6ba473846ccebdd4330c)
+++ sources/app/src/main/java/parkup/entities/ParkingSpace.java	(revision ce6ad22249e902dea17e6ba473846ccebdd4330c)
@@ -0,0 +1,78 @@
+package parkup.entities;
+
+import javax.persistence.*;
+
+@Entity
+@Table(name = "parking_space")
+public class ParkingSpace {
+    @Id
+    @Column(name = "parking_space_id")
+    @SequenceGenerator(
+            name="parking_space_generator",
+            sequenceName = "parking_space_sequence",
+            allocationSize = 1,
+            initialValue = 600
+    )
+    @GeneratedValue(    //za postgres treba sequence da se namesti i ime na generator mi ga davamo kako od gore sto e
+            strategy = GenerationType.SEQUENCE,
+            generator = "parking_space_sequence_generator"
+    )
+    private int psId;
+
+    @Column(name = "psName")
+    private String psName;
+
+    @Column(name = "isTaken")
+    private boolean isTaken;
+
+    @Column(name = "isHandicaped")
+    private boolean isHandicaped;
+
+    public ParkingSpace() {}
+
+    public ParkingSpace(int psId, String psName, boolean isTaken, boolean isHandicaped) {
+        this.psId = psId;
+        this.psName = psName;
+        this.isTaken = isTaken;
+        this.isHandicaped = isHandicaped;
+    }
+
+    public ParkingSpace(String psName, boolean isTaken, boolean isHandicaped) {
+        this.psName = psName;
+        this.isTaken = isTaken;
+        this.isHandicaped = isHandicaped;
+    }
+
+    public int getPsId() {
+        return this.psId;
+    }
+
+    public void setPsId(int psId) {
+        this.psId = psId;
+    }
+
+    public String getPsName() {
+        return this.psName;
+    }
+
+    public void setPsName(String psName) {
+        this.psName = psName;
+    }
+
+    public boolean isTaken() {
+        return this.isTaken;
+    }
+
+    public void setTaken(boolean isTaken) {
+        this.isTaken = isTaken;
+    }
+
+    public boolean isHandicaped() {
+        return this.isHandicaped;
+    }
+
+    public void setHandicaped(boolean isHandicaped) {
+        this.isHandicaped = isHandicaped;
+    }
+}
+
Index: sources/app/src/main/java/parkup/entities/ParkingZone.java
===================================================================
--- sources/app/src/main/java/parkup/entities/ParkingZone.java	(revision ce6ad22249e902dea17e6ba473846ccebdd4330c)
+++ sources/app/src/main/java/parkup/entities/ParkingZone.java	(revision ce6ad22249e902dea17e6ba473846ccebdd4330c)
@@ -0,0 +1,127 @@
+package parkup.entities;
+
+import javax.persistence.*;
+import java.util.ArrayList;
+import java.util.List;
+
+@Entity
+@Table(name = "parking_zone")
+public class ParkingZone {
+    @Id
+    @SequenceGenerator(
+            name="parking_zone_generator",
+            sequenceName = "parking_zone_sequence",
+            allocationSize = 1,
+            initialValue = 500
+    )
+    @GeneratedValue(    //za postgres treba sequence da se namesti i ime na generator mi ga davamo kako od gore sto e
+            strategy = GenerationType.SEQUENCE,
+            generator = "parking_zone_sequence_generator"
+    )
+    @Column(name = "parking_zone_id")
+    private int pzId;
+
+    @Column(name = "pz_name")
+    private String pzName;
+
+    @Column(name = "price")
+    private int price;
+
+    @Column(name = "capacity")
+    private int capacity;
+
+    @Column(name = "work_hours")
+    private String workHours;
+
+    @Column(name = "location")
+    private String location;
+
+    @Column(name = "zafateniMesta")
+    private int zafateniMesta;
+
+    @OneToMany(cascade = {CascadeType.ALL})
+    @JoinColumn(name = "parkingSpaces", nullable = false)
+    private List<ParkingSpace> parkingSpaces;
+
+    public ParkingZone() {
+        this.zafateniMesta = 0;
+        this.parkingSpaces = new ArrayList<ParkingSpace>();
+    }
+
+    public ParkingZone(int pzId, String pzName, int price, int capacity, String workHours, String location, List<ParkingSpace> parkingSpaces) {
+        this.pzId = pzId;
+        this.pzName = pzName;
+        this.price = price;
+        this.capacity = capacity;
+        this.workHours = workHours;
+        this.location = location;
+        this.zafateniMesta = 0;
+        this.parkingSpaces = parkingSpaces;
+    }
+
+    public ParkingZone(String pzName, int price, int capacity, String workHours, String location, List<ParkingSpace> parkingSpaces) {
+        this.pzName = pzName;
+        this.price = price;
+        this.capacity = capacity;
+        this.workHours = workHours;
+        this.location = location;
+        this.zafateniMesta = 0;
+        this.parkingSpaces = parkingSpaces;
+    }
+
+    public int getId() {
+        return this.pzId;
+    }
+
+    public void setId(int pzId) {
+        this.pzId = pzId;
+    }
+
+    public String getPzName() {
+        return this.pzName;
+    }
+
+    public void setPzName(String pzName) {
+        this.pzName = pzName;
+    }
+
+    public int getPrice() {
+        return this.price;
+    }
+
+    public void setPrice(int price) {
+        this.price = price;
+    }
+
+    public int getCapacity() {
+        return this.capacity;
+    }
+
+    public void setCapacity(int capacity) {
+        this.capacity = capacity;
+    }
+
+    public String getWorkHours() {
+        return this.workHours;
+    }
+
+    public void setWorkHours(String workHours) {
+        this.workHours = workHours;
+    }
+
+    public String getLocation() {
+        return this.location;
+    }
+
+    public void setLocation(String location) {
+        this.location = location;
+    }
+
+    public int getZafateniMesta() {return zafateniMesta;}
+
+    public void setZafateniMesta(int zafateniMesta) {this.zafateniMesta = zafateniMesta;}
+
+    public List<ParkingSpace> getParkingSpaces() {return parkingSpaces;}
+
+    public void setParkingSpaces(List<ParkingSpace> parkingSpaces) {this.parkingSpaces = parkingSpaces;}
+}
Index: sources/app/src/main/java/parkup/entities/RegistriranParkirac.java
===================================================================
--- sources/app/src/main/java/parkup/entities/RegistriranParkirac.java	(revision ce6ad22249e902dea17e6ba473846ccebdd4330c)
+++ sources/app/src/main/java/parkup/entities/RegistriranParkirac.java	(revision ce6ad22249e902dea17e6ba473846ccebdd4330c)
@@ -0,0 +1,135 @@
+package parkup.entities;
+
+import java.util.ArrayList;
+import java.util.List;
+import javax.persistence.*;
+
+import parkup.data.Tablicka;
+
+@Entity
+@Table(name = "registriranParkirac")
+public class RegistriranParkirac {
+    @Id
+    @SequenceGenerator(
+            name="registriranParkirac_sequence_generator",
+            sequenceName = "registriranParkirac_sequence",
+            allocationSize = 1,
+            initialValue = 300
+    )
+    @GeneratedValue(    //za postgres treba sequence da se namesti i ime na generator mi ga davamo kako od gore sto e
+            strategy = GenerationType.SEQUENCE,
+            generator = "registriranParkirac_sequence_generator"
+    )
+    @Column(name = "regParkId")
+    private int regParkId;
+
+    @Column(name = "name")
+    private String name;
+
+    @Column(name = "surname")
+    private String surname;
+
+    @Column(name = "password")
+    private String password;
+
+    @OneToMany
+    @Column(name = "regTablicki")
+    private List<Tablicka> regTablicki;
+
+    @Column(name = "email")
+    private String email;
+
+    @Column(name = "mobile")
+    private String mobile;
+
+    @Column(name = "role")
+    private String role;
+
+    public RegistriranParkirac() {
+
+        this.regTablicki = new ArrayList<Tablicka>();
+        this.role = "ROLE_REGISTIRAN_PARKIRAC";
+    }
+
+    public RegistriranParkirac(int regParkId, String name, String surname, String password, List<Tablicka> regTablicki, String email, String mobile) {
+        this.regParkId = regParkId;
+        this.name = name;
+        this.surname = surname;
+        this.password = password;
+        this.regTablicki = regTablicki;
+        this.email = email;
+        this.mobile = mobile;
+        this.role = "ROLE_REGISTIRAN_PARKIRAC";
+    }
+
+    public RegistriranParkirac(String name, String surname, String password, List<Tablicka> regTablicki, String email, String mobile) {
+        this.name = name;
+        this.surname = surname;
+        this.password = password;
+        this.regTablicki = regTablicki;
+        this.email = email;
+        this.mobile = mobile;
+        this.role = "ROLE_REGISTIRAN_PARKIRAC";
+    }
+
+    public int getRegParkId() {
+        return regParkId;
+    }
+
+    public void setRegParkId(int regParkId) {
+        this.regParkId = regParkId;
+    }
+
+    public String getName() {
+        return name;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+
+    public String getSurname() {
+        return surname;
+    }
+
+    public void setSurname(String surname) {
+        this.surname = surname;
+    }
+
+    public String getPassword() {
+        return password;
+    }
+
+    public void setPassword(String password) {
+        this.password = password;
+    }
+
+    public List<Tablicka> getRegTablicki() {
+        return regTablicki;
+    }
+
+    public void setRegTablicki(List<Tablicka> regTablicki) {
+        this.regTablicki = regTablicki;
+    }
+
+    public String getEmail() {
+        return email;
+    }
+
+    public void setEmail(String email) {
+        this.email = email;
+    }
+
+    public String getMobile() {
+        return mobile;
+    }
+
+    public void setMobile(String mobile) {
+        this.mobile = mobile;
+    }
+
+    public String getRole() {return role;}
+
+    public void setRole(String role) {this.role = role;}
+}
+
Index: sources/app/src/main/java/parkup/entities/Vraboten.java
===================================================================
--- sources/app/src/main/java/parkup/entities/Vraboten.java	(revision ce6ad22249e902dea17e6ba473846ccebdd4330c)
+++ sources/app/src/main/java/parkup/entities/Vraboten.java	(revision ce6ad22249e902dea17e6ba473846ccebdd4330c)
@@ -0,0 +1,149 @@
+package parkup.entities;
+
+import parkup.data.Tablicka;
+
+import javax.persistence.*;
+import java.util.ArrayList;
+import java.util.List;
+
+@Entity
+@Table(name = "vraboten")
+public class Vraboten {
+    @Id
+    @SequenceGenerator(
+            name="vraboten_sequence_generator",
+            sequenceName = "vraboten_sequence",
+            allocationSize = 1,
+            initialValue = 200
+    )
+    @GeneratedValue(    //za postgres treba sequence da se namesti i ime na generator mi ga davamo kako od gore sto e
+            strategy = GenerationType.SEQUENCE,
+            generator = "vraboten_sequence_generator"
+    )
+    @Column(name = "vrabotenId")
+    private int vrabotenId;
+
+    @Column(name = "firstName")
+    private String firstName;
+
+    @Column(name = "lastName")
+    private String lastName;
+
+    @Column(name = "email")
+    private String email;
+
+    @Column(name = "password")
+    private String password;
+
+    @Column(name = "mobile")
+    private String mobile;
+
+    @Column(name = "role")
+    private String role;
+
+    @ManyToMany(cascade = {CascadeType.ALL})
+    @JoinColumn(name = "zona", nullable = false)
+    private List<ParkingZone> parkingZones;
+
+    @Column(name = "status")
+    private String status;
+
+    @Column(name = "account")
+    private boolean account;
+
+    public Vraboten() {
+        this.role = "ROLE_VRABOTEN";
+        this.parkingZones = new ArrayList<ParkingZone>();
+        this.account = true;
+        this.status = "neRaboti";
+    }
+
+    public Vraboten(int vrabotenId, String firstName, String lastName, String email, String password, String mobile, List<ParkingZone> parkingZones) {
+        this.vrabotenId = vrabotenId;
+        this.firstName = firstName;
+        this.lastName = lastName;
+        this.email = email;
+        this.password = password;
+        this.mobile = mobile;
+        this.parkingZones = parkingZones;
+        this.role = "ROLE_VRABOTEN";
+        this.account = true;
+        this.status = "neRaboti";
+    }
+
+    public Vraboten(String firstName, String lastName, String email, String password, String mobile, List<ParkingZone> parkingZones) {
+        this.firstName = firstName;
+        this.lastName = lastName;
+        this.email = email;
+        this.password = password;
+        this.mobile = mobile;
+        this.parkingZones = parkingZones;
+        this.role = "ROLE_VRABOTEN";
+        this.account = true;
+        this.status = "neRaboti";
+    }
+
+    public int getVrabotenId() {
+        return vrabotenId;
+    }
+
+    public void setVrabotenId(int vrabotenId) {
+        this.vrabotenId = vrabotenId;
+    }
+
+    public String getFirstName() {
+        return firstName;
+    }
+
+    public void setFirstName(String firstName) {
+        this.firstName = firstName;
+    }
+
+    public String getLastName() {
+        return lastName;
+    }
+
+    public void setLastName(String lastName) {
+        this.lastName = lastName;
+    }
+
+    public String getEmail() {
+        return email;
+    }
+
+    public void setEmail(String email) {
+        this.email = email;
+    }
+
+    public String getPassword() {
+        return password;
+    }
+
+    public void setPassword(String password) {
+        this.password = password;
+    }
+
+    public String getMobile() {
+        return mobile;
+    }
+
+    public void setMobile(String mobile) {
+        this.mobile = mobile;
+    }
+
+    public String getRole() {return role;}
+
+    public void setRole(String role) {this.role = role;}
+
+    public List<ParkingZone> getParkingZones() {return parkingZones;}
+
+    public void setParkingZones(List<ParkingZone> parkingZones) {this.parkingZones = parkingZones;}
+
+    public String getStatus() {return status;}
+
+    public void setStatus(String status) {this.status = status;}
+
+    public boolean isAccount() {return account;}
+
+    public void setAccount(boolean account) {this.account = account;}
+}
Index: sources/app/src/main/java/parkup/repositories/AdministratorRepository.java
===================================================================
--- sources/app/src/main/java/parkup/repositories/AdministratorRepository.java	(revision ce6ad22249e902dea17e6ba473846ccebdd4330c)
+++ sources/app/src/main/java/parkup/repositories/AdministratorRepository.java	(revision ce6ad22249e902dea17e6ba473846ccebdd4330c)
@@ -0,0 +1,26 @@
+package parkup.repositories;
+
+import java.util.Optional;
+import org.springframework.data.jpa.repository.JpaRepository;
+import org.springframework.data.jpa.repository.Modifying;
+import org.springframework.data.jpa.repository.Query;
+import org.springframework.stereotype.Repository;
+import parkup.entities.Administrator;
+
+import javax.transaction.Transactional;
+
+@Repository
+public interface AdministratorRepository extends JpaRepository<Administrator, Integer> {
+
+    Administrator findByAdministratorId(int id);
+
+    void deleteByAdministratorId(int id);
+
+    Optional<Administrator> findAdministratorByEmail(String email);
+
+    @Transactional
+    @Modifying
+    @Query("UPDATE Administrator a " +
+            "SET a.enabled = TRUE WHERE a.email = ?1")
+    int enableAdministrator(String email);
+}
Index: sources/app/src/main/java/parkup/repositories/GuestRepository.java
===================================================================
--- sources/app/src/main/java/parkup/repositories/GuestRepository.java	(revision ce6ad22249e902dea17e6ba473846ccebdd4330c)
+++ sources/app/src/main/java/parkup/repositories/GuestRepository.java	(revision ce6ad22249e902dea17e6ba473846ccebdd4330c)
@@ -0,0 +1,13 @@
+package parkup.repositories;
+
+import java.util.Optional;
+import org.springframework.data.jpa.repository.JpaRepository;
+import parkup.entities.Guest;
+
+public interface GuestRepository extends JpaRepository<Guest, Integer> {
+    Guest findByGuestId(int id);
+
+    void deleteByGuestId(int id);
+
+    Optional<Guest> findGuestByEmail(String email);
+}
Index: sources/app/src/main/java/parkup/repositories/ParkingSessionRepository.java
===================================================================
--- sources/app/src/main/java/parkup/repositories/ParkingSessionRepository.java	(revision ce6ad22249e902dea17e6ba473846ccebdd4330c)
+++ sources/app/src/main/java/parkup/repositories/ParkingSessionRepository.java	(revision ce6ad22249e902dea17e6ba473846ccebdd4330c)
@@ -0,0 +1,11 @@
+package parkup.repositories;
+
+import org.springframework.data.jpa.repository.JpaRepository;
+import parkup.entities.ParkingSession;
+
+public interface ParkingSessionRepository extends JpaRepository<ParkingSession, Integer> {
+
+    ParkingSession findByPssId(int parkingSessionId);
+
+    void deleteByPssId(int parkingSessionId);
+}
Index: sources/app/src/main/java/parkup/repositories/ParkingSpaceRepository.java
===================================================================
--- sources/app/src/main/java/parkup/repositories/ParkingSpaceRepository.java	(revision ce6ad22249e902dea17e6ba473846ccebdd4330c)
+++ sources/app/src/main/java/parkup/repositories/ParkingSpaceRepository.java	(revision ce6ad22249e902dea17e6ba473846ccebdd4330c)
@@ -0,0 +1,12 @@
+package parkup.repositories;
+
+import org.springframework.data.jpa.repository.JpaRepository;
+import parkup.entities.ParkingSpace;
+
+public interface ParkingSpaceRepository extends JpaRepository<ParkingSpace, Integer> {
+    ParkingSpace findByPsName(String psName);
+
+    ParkingSpace findByPsId(int parkingSpaceId);
+
+    void deleteByPsId(int parkingSpaceId);
+}
Index: sources/app/src/main/java/parkup/repositories/ParkingZoneRepository.java
===================================================================
--- sources/app/src/main/java/parkup/repositories/ParkingZoneRepository.java	(revision ce6ad22249e902dea17e6ba473846ccebdd4330c)
+++ sources/app/src/main/java/parkup/repositories/ParkingZoneRepository.java	(revision ce6ad22249e902dea17e6ba473846ccebdd4330c)
@@ -0,0 +1,12 @@
+package parkup.repositories;
+
+import org.springframework.data.jpa.repository.JpaRepository;
+import parkup.entities.ParkingZone;
+
+public interface ParkingZoneRepository extends JpaRepository<ParkingZone, Integer> {
+    ParkingZone findByPzId(int id);
+
+    ParkingZone findByPzName(String name);
+
+    void deleteByPzId(int id);
+}
Index: sources/app/src/main/java/parkup/repositories/RegistriranParkiracRepository.java
===================================================================
--- sources/app/src/main/java/parkup/repositories/RegistriranParkiracRepository.java	(revision ce6ad22249e902dea17e6ba473846ccebdd4330c)
+++ sources/app/src/main/java/parkup/repositories/RegistriranParkiracRepository.java	(revision ce6ad22249e902dea17e6ba473846ccebdd4330c)
@@ -0,0 +1,13 @@
+package parkup.repositories;
+
+import java.util.Optional;
+import org.springframework.data.jpa.repository.JpaRepository;
+import parkup.entities.RegistriranParkirac;
+
+public interface RegistriranParkiracRepository extends JpaRepository<RegistriranParkirac, Integer> {
+    RegistriranParkirac findByRegParkId(int regParkId);
+
+    void deleteByRegParkId(int regParkId);
+
+    Optional<RegistriranParkirac> findRegistriranParkiracByEmail(String email);
+}
Index: sources/app/src/main/java/parkup/repositories/VrabotenRepository.java
===================================================================
--- sources/app/src/main/java/parkup/repositories/VrabotenRepository.java	(revision ce6ad22249e902dea17e6ba473846ccebdd4330c)
+++ sources/app/src/main/java/parkup/repositories/VrabotenRepository.java	(revision ce6ad22249e902dea17e6ba473846ccebdd4330c)
@@ -0,0 +1,13 @@
+package parkup.repositories;
+
+import java.util.Optional;
+import org.springframework.data.jpa.repository.JpaRepository;
+import parkup.entities.Vraboten;
+
+public interface VrabotenRepository extends JpaRepository<Vraboten, Integer> {
+    Vraboten findByVrabotenId(int id);
+
+    void deleteByVrabotenId(int id);
+
+    Optional<Vraboten> findVrabotenByEmail(String email);
+}
Index: sources/app/src/main/java/parkup/services/AdministratorService.java
===================================================================
--- sources/app/src/main/java/parkup/services/AdministratorService.java	(revision ce6ad22249e902dea17e6ba473846ccebdd4330c)
+++ sources/app/src/main/java/parkup/services/AdministratorService.java	(revision ce6ad22249e902dea17e6ba473846ccebdd4330c)
@@ -0,0 +1,145 @@
+package parkup.services;
+
+import java.time.LocalDateTime;
+import java.util.List;
+import java.util.Objects;
+import java.util.Optional;
+import java.util.UUID;
+import javax.transaction.Transactional;
+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;
+import parkup.configs.email.EmailValidator;
+import parkup.configs.token.ConfirmationToken;
+import parkup.configs.token.ConfirmationTokenService;
+import parkup.entities.Administrator;
+import parkup.repositories.AdministratorRepository;
+
+@Service
+public class AdministratorService implements UserDetailsService {
+    private final AdministratorRepository administratorRepository;
+    private final BCryptPasswordEncoder bCryptPasswordEncoder;
+    private final ConfirmationTokenService confirmationTokenService;
+    private EmailValidator emailValidator;
+
+    @Autowired
+    public AdministratorService(AdministratorRepository administratorRepository, BCryptPasswordEncoder bCryptPasswordEncoder, ConfirmationTokenService confirmationTokenService) {
+        this.administratorRepository = administratorRepository;
+        this.bCryptPasswordEncoder = bCryptPasswordEncoder;
+        this.confirmationTokenService = confirmationTokenService;
+    }
+
+    public List<Administrator> getAllAdministrators() {
+        return this.administratorRepository.findAll();
+    }
+
+    public Administrator findById(int administratorId) {
+        Optional<Administrator> administrator = Optional.ofNullable(this.administratorRepository.findByAdministratorId(administratorId));
+        return administrator.orElse(null);
+    }
+
+    public void addAdministrator(Administrator administrator) {
+        Optional<Administrator> administratorOpt = this.administratorRepository.findAdministratorByEmail(administrator.getEmail());
+        if (administratorOpt.isPresent()) {
+            throw new IllegalStateException("Email already taken, try adding an administrator with a different valid email address");
+        } else {
+            System.out.println(administrator);
+            this.administratorRepository.save(administrator);
+        }
+    }
+
+    @Transactional
+    public void updateAdministrator(int administratorId, String firstName, String lastName, String mobile, String email) {
+        Optional<Administrator> administratorOpt = Optional.ofNullable(this.administratorRepository.findByAdministratorId(administratorId));
+        if (administratorOpt.isPresent()) {
+            Administrator administratorNov = this.administratorRepository.findByAdministratorId(administratorId);
+            if (email != null && email.length() > 1 && email.contains("@") && !Objects.equals(administratorNov.getEmail(), email)) {
+                Optional<Administrator> userOpt1 = this.administratorRepository.findAdministratorByEmail(email);
+                if (userOpt1.isPresent()) {
+                    throw new IllegalStateException("email taken");
+                }
+
+                administratorNov.setEmail(email);
+            }
+
+            if (firstName != null && firstName.length() > 1 && !Objects.equals(administratorNov.getFirstName(), firstName)) {
+                administratorNov.setFirstName(firstName);
+            }
+
+            if (lastName != null && lastName.length() > 1 && !Objects.equals(administratorNov.getLastName(), lastName)) {
+                administratorNov.setLastName(lastName);
+            }
+
+            if (mobile != null && mobile.length() > 0 && !Objects.equals(administratorNov.getMobile(), mobile)) {
+                administratorNov.setMobile(mobile);
+            }
+        }
+    }
+
+    public void deleteAdministrator(int administratorId) {
+        Optional<Administrator> administratorOpt = Optional.ofNullable(this.administratorRepository.findByAdministratorId(administratorId));
+        if (administratorOpt.isPresent()) {
+            this.administratorRepository.deleteByAdministratorId(administratorId);
+        } else {
+            throw new IllegalStateException("Administrator doesn't exist, therefore can't be deleted");
+        }
+    }
+
+    @Override
+    public UserDetails loadUserByUsername(String email) throws UsernameNotFoundException {
+        return administratorRepository.findAdministratorByEmail(email)
+                .orElseThrow(() ->
+                        new UsernameNotFoundException("Email not found"));
+
+    }
+
+   //public String register(RegistrationRequest request) {
+   //    boolean isValidEmail = emailValidator.test(request.getEmail());
+   //    if (!isValidEmail){
+   //        throw new IllegalStateException("Email not valid");
+   //    }
+   //    return "it works";
+   //}
+
+    public String signUpAdministrator(Administrator administrator){
+        boolean administratorExists = administratorRepository
+                .findAdministratorByEmail(administrator.getEmail())
+                .isPresent();
+        if(administratorExists){
+            // TODO check if attributes are the same and
+            // TODO if email not confirmed send confirmation email
+
+            throw new IllegalStateException("Email already taken");
+        }
+
+        String encodedPassword = bCryptPasswordEncoder
+                .encode(administrator.getPassword());
+
+        administrator.setPassword(encodedPassword);
+
+        administratorRepository.save(administrator);
+
+        // TODO: Send confirmation token
+
+        String token = UUID.randomUUID().toString();
+        ConfirmationToken confirmationToken = new ConfirmationToken(
+                token,
+                LocalDateTime.now(),
+                LocalDateTime.now().plusMinutes(15),
+                administrator
+        );
+
+        confirmationTokenService.saveConfirmationToken(confirmationToken);
+
+        // TODO: SEND EMAIL
+
+        return token;
+    }
+
+    public int enableAdministrator(String email) {
+        return administratorRepository.enableAdministrator(email);
+    }
+}
Index: sources/app/src/main/java/parkup/services/GuestService.java
===================================================================
--- sources/app/src/main/java/parkup/services/GuestService.java	(revision ce6ad22249e902dea17e6ba473846ccebdd4330c)
+++ sources/app/src/main/java/parkup/services/GuestService.java	(revision ce6ad22249e902dea17e6ba473846ccebdd4330c)
@@ -0,0 +1,46 @@
+package parkup.services;
+
+import java.util.List;
+import java.util.Optional;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import parkup.entities.Guest;
+import parkup.repositories.GuestRepository;
+
+@Service
+public class GuestService {
+    private final GuestRepository guestRepository;
+
+    @Autowired
+    public GuestService(GuestRepository guestRepository) {
+        this.guestRepository = guestRepository;
+    }
+
+    public List<Guest> getGuests() {
+        return this.guestRepository.findAll();
+    }
+
+    public Guest findById(int guestId) {
+        Optional<Guest> guest = Optional.ofNullable(this.guestRepository.findByGuestId(guestId));
+        return guest.orElse(null);
+    }
+
+    public void addGuest(Guest guest) {
+        Optional<Guest> guestOpt = this.guestRepository.findGuestByEmail(guest.getEmail());
+        if (guestOpt.isPresent()) {
+            throw new IllegalStateException("Email already taken, try adding a guest with a different valid email address");
+        } else {
+            System.out.println(guest);
+            this.guestRepository.save(guest);
+        }
+    }
+
+    public void deleteGuest(int guestId) {
+        Optional<Guest> guest = Optional.ofNullable(this.guestRepository.findByGuestId(guestId));
+        if (guest.isPresent()) {
+            this.guestRepository.deleteByGuestId(guestId);
+        } else {
+            throw new IllegalStateException("Guest doesn't exist, therefore can't be deleted");
+        }
+    }
+}
Index: sources/app/src/main/java/parkup/services/ParkingSessionService.java
===================================================================
--- sources/app/src/main/java/parkup/services/ParkingSessionService.java	(revision ce6ad22249e902dea17e6ba473846ccebdd4330c)
+++ sources/app/src/main/java/parkup/services/ParkingSessionService.java	(revision ce6ad22249e902dea17e6ba473846ccebdd4330c)
@@ -0,0 +1,60 @@
+package parkup.services;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import parkup.entities.ParkingSession;
+import parkup.repositories.ParkingSessionRepository;
+
+import java.util.List;
+import java.util.Objects;
+import java.util.Optional;
+
+@Service
+public class ParkingSessionService {
+    private final ParkingSessionRepository parkingSessionRepository;
+
+    @Autowired
+    public ParkingSessionService(ParkingSessionRepository parkingSessionRepository) {
+        this.parkingSessionRepository = parkingSessionRepository;
+    }
+
+    public List<ParkingSession> getAllParkingSessions() {
+        return parkingSessionRepository.findAll();
+    }
+
+    public ParkingSession findById(int parkingSessionId) {
+        Optional<ParkingSession> parkingSessionOpt = Optional.ofNullable(parkingSessionRepository.findByPssId(parkingSessionId));
+        return parkingSessionOpt.orElse(null);
+    }
+
+    public void updateParkingSession(int parkingSessionId, String timeStart, String timeEnd) {
+        Optional<ParkingSession> parkingSessionOpt = Optional.ofNullable(parkingSessionRepository.findByPssId(parkingSessionId));
+        if (parkingSessionOpt.isPresent()) {
+            ParkingSession parkingSessionNov = parkingSessionRepository.findByPssId(parkingSessionId);
+            if(!parkingSessionNov.getTimeStart().equals(timeStart) && !parkingSessionNov.getTimeStart().equals(timeEnd))
+                parkingSessionNov.setTimeStart(timeStart);
+
+            if(!parkingSessionNov.getTimeEnd().equals(timeEnd) && !parkingSessionNov.getTimeEnd().equals(timeStart))
+                parkingSessionNov.setTimeEnd(timeEnd);
+        }
+    }
+
+    public void deleteParkingSession(int parkingSessionId) {
+        Optional<ParkingSession> parkingSessionOpt = Optional.ofNullable(parkingSessionRepository.findByPssId(parkingSessionId));
+        if (parkingSessionOpt.isPresent()) {
+            parkingSessionRepository.deleteByPssId(parkingSessionId);
+        } else {
+            throw new IllegalStateException("ParkingSpace doesn't exist, therefore can't be deleted");
+        }
+    }
+
+    public void addParkingSession(ParkingSession parkingSession) {
+        Optional <ParkingSession> parkingSessionOpt = Optional.ofNullable(parkingSessionRepository.findByPssId(parkingSession.getPssId()));
+        if (parkingSessionOpt.isPresent()) {
+            throw new IllegalStateException("ID already taken, ParkingSession cannot be added");
+        } else {
+            System.out.println(parkingSession);
+            parkingSessionRepository.save(parkingSession);
+        }
+    }
+}
Index: sources/app/src/main/java/parkup/services/ParkingSpaceService.java
===================================================================
--- sources/app/src/main/java/parkup/services/ParkingSpaceService.java	(revision ce6ad22249e902dea17e6ba473846ccebdd4330c)
+++ sources/app/src/main/java/parkup/services/ParkingSpaceService.java	(revision ce6ad22249e902dea17e6ba473846ccebdd4330c)
@@ -0,0 +1,71 @@
+package parkup.services;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import parkup.entities.ParkingSpace;
+import parkup.repositories.ParkingSpaceRepository;
+
+import java.util.List;
+import java.util.Objects;
+import java.util.Optional;
+
+@Service
+public class ParkingSpaceService {
+    private final ParkingSpaceRepository parkingSpaceRepository;
+
+    @Autowired
+    public ParkingSpaceService(ParkingSpaceRepository parkingSpaceRepository) {
+        this.parkingSpaceRepository = parkingSpaceRepository;
+    }
+
+    public List<ParkingSpace> getAllParkingSpaces() {
+        return parkingSpaceRepository.findAll();
+    }
+
+    public ParkingSpace findById(int parkingSpaceId) {
+        Optional<ParkingSpace> parkingSpaceOpt = Optional.ofNullable(parkingSpaceRepository.findByPsId(parkingSpaceId));
+        return parkingSpaceOpt.orElse(null);
+    }
+
+    public void addParkingSpace(ParkingSpace parkingSpace) {
+        Optional <ParkingSpace> parkingSpaceOpt = Optional.ofNullable(parkingSpaceRepository.findByPsName(parkingSpace.getPsName()));
+        if (parkingSpaceOpt.isPresent()) {
+            throw new IllegalStateException("Name already taken, try adding a ParkingZone with a different name");
+        } else {
+            System.out.println(parkingSpace);
+            parkingSpaceRepository.save(parkingSpace);
+        }
+    }
+
+    public void updateParkingSpace(int parkingSpaceId, String psName, boolean taken, boolean handicaped) {
+        Optional<ParkingSpace> ParkingSpaceOpt = Optional.ofNullable(parkingSpaceRepository.findByPsId(parkingSpaceId));
+        if (ParkingSpaceOpt.isPresent()) {
+            ParkingSpace ParkingSpaceNov = parkingSpaceRepository.findByPsId(parkingSpaceId);
+            if (psName != null && psName.length() > 1 && !Objects.equals(ParkingSpaceNov.getPsName(), psName)) {
+                Optional<ParkingSpace> parkingSpaceOpt1 = Optional.ofNullable(parkingSpaceRepository.findByPsName(psName));
+                if (parkingSpaceOpt1.isPresent()) {
+                    throw new IllegalStateException("There is already a ParkingSpace with the same name");
+                }
+
+                ParkingSpaceNov.setPsName(psName);
+            }
+
+            if (!Objects.equals(ParkingSpaceNov.isTaken(), taken)) {
+                ParkingSpaceNov.setTaken(taken);
+            }
+
+            if (!Objects.equals(ParkingSpaceNov.isHandicaped(), handicaped)) {
+                ParkingSpaceNov.setHandicaped(handicaped);
+            }
+        }
+    }
+
+    public void deleteParkingSpace(int parkingSpaceId) {
+        Optional<ParkingSpace> parkingSpaceOpt = Optional.ofNullable(parkingSpaceRepository.findByPsId(parkingSpaceId));
+        if (parkingSpaceOpt.isPresent()) {
+            parkingSpaceRepository.deleteByPsId(parkingSpaceId);
+        } else {
+            throw new IllegalStateException("ParkingSpace doesn't exist, therefore can't be deleted");
+        }
+    }
+}
Index: sources/app/src/main/java/parkup/services/ParkingZoneService.java
===================================================================
--- sources/app/src/main/java/parkup/services/ParkingZoneService.java	(revision ce6ad22249e902dea17e6ba473846ccebdd4330c)
+++ sources/app/src/main/java/parkup/services/ParkingZoneService.java	(revision ce6ad22249e902dea17e6ba473846ccebdd4330c)
@@ -0,0 +1,82 @@
+package parkup.services;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import parkup.entities.Administrator;
+import parkup.entities.ParkingZone;
+import parkup.repositories.ParkingZoneRepository;
+
+import javax.transaction.Transactional;
+import java.util.List;
+import java.util.Objects;
+import java.util.Optional;
+
+@Service
+public class ParkingZoneService {
+    private final ParkingZoneRepository parkingZoneRepository;
+
+    @Autowired
+    public ParkingZoneService(ParkingZoneRepository parkingZoneRepository) {
+        this.parkingZoneRepository = parkingZoneRepository;
+    }
+
+    public List<ParkingZone> getAllParkingZones() {
+        return parkingZoneRepository.findAll();
+    }
+
+    public ParkingZone findById(int parkingZoneId) {
+        Optional<ParkingZone> parkingZone = Optional.ofNullable(this.parkingZoneRepository.findByPzId(parkingZoneId));
+        return parkingZone.orElse(null);
+    }
+
+    public void addParkingZone(ParkingZone parkingZone) {   //zavisno vo koj grad ili opstina i napravi proverki pred dodavanje, implementiraj u naredna faza
+        Optional<ParkingZone> parkingZoneOpt = Optional.ofNullable(parkingZoneRepository.findByPzName(parkingZone.getPzName()));
+        if (parkingZoneOpt.isPresent()) {
+            throw new IllegalStateException("Name already taken, try adding a ParkingZone with a different name");
+        } else {
+            System.out.println(parkingZone);
+            parkingZoneRepository.save(parkingZone);
+        }
+    }
+
+    @Transactional
+    public void updateParkingZone(int parkingZoneId, String pzName, int price, int capacity, String workHours, String location) {
+        Optional<ParkingZone> parkingZoneOpt = Optional.ofNullable(parkingZoneRepository.findByPzId(parkingZoneId));
+        if (parkingZoneOpt.isPresent()) {
+            ParkingZone parkingZoneNov = parkingZoneRepository.findByPzId(parkingZoneId);
+            if (pzName != null && pzName.length() > 1 && !Objects.equals(parkingZoneNov.getPzName(), pzName)) {
+                Optional<ParkingZone> parkingZoneOpt1 = Optional.ofNullable(parkingZoneRepository.findByPzName(pzName));
+                if (parkingZoneOpt1.isPresent()) {
+                    throw new IllegalStateException("There is already a ParkingZone with the same name");
+                }
+
+                parkingZoneNov.setPzName(pzName);
+            }
+
+            if (price != 0 && !Objects.equals(parkingZoneNov.getPrice(), price)) {
+                parkingZoneNov.setPrice(price);
+            }
+
+            if (capacity != 0 && !Objects.equals(parkingZoneNov.getCapacity(), capacity)) {
+                parkingZoneNov.setCapacity(capacity);
+            }
+
+            if (workHours != null && workHours.length() > 0 && !Objects.equals(parkingZoneNov.getWorkHours(), workHours)) {
+                parkingZoneNov.setWorkHours(workHours);
+            }
+
+            if (location != null && location.length() > 0 && !Objects.equals(parkingZoneNov.getLocation(), location)) {
+                parkingZoneNov.setLocation(location);
+            }
+        }
+    }
+
+    public void deleteParkingZone(int parkingZoneId) {
+        Optional<ParkingZone> parkingZoneOpt = Optional.ofNullable(parkingZoneRepository.findByPzId(parkingZoneId));
+        if (parkingZoneOpt.isPresent()) {
+            parkingZoneRepository.deleteByPzId(parkingZoneId);
+        } else {
+            throw new IllegalStateException("ParkingZone doesn't exist, therefore can't be deleted");
+        }
+    }
+}
Index: sources/app/src/main/java/parkup/services/RegistriranParkiracService.java
===================================================================
--- sources/app/src/main/java/parkup/services/RegistriranParkiracService.java	(revision ce6ad22249e902dea17e6ba473846ccebdd4330c)
+++ sources/app/src/main/java/parkup/services/RegistriranParkiracService.java	(revision ce6ad22249e902dea17e6ba473846ccebdd4330c)
@@ -0,0 +1,76 @@
+package parkup.services;
+
+import java.util.List;
+import java.util.Objects;
+import java.util.Optional;
+import javax.transaction.Transactional;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import parkup.entities.RegistriranParkirac;
+import parkup.repositories.RegistriranParkiracRepository;
+
+@Service
+public class RegistriranParkiracService {
+    private final RegistriranParkiracRepository registriranParkiracRepository;
+
+    @Autowired
+    public RegistriranParkiracService(RegistriranParkiracRepository registriranParkiracRepository) {
+        this.registriranParkiracRepository = registriranParkiracRepository;
+    }
+
+    public List<RegistriranParkirac> getRegPark() {
+        return this.registriranParkiracRepository.findAll();
+    }
+
+    public void addRegPark(RegistriranParkirac regPark) {
+        Optional<RegistriranParkirac> regParkOpt = this.registriranParkiracRepository.findRegistriranParkiracByEmail(regPark.getEmail());
+        if (regParkOpt.isPresent()) {
+            throw new IllegalStateException("Email already taken, try adding a registriranParkirac with a different valid email address");
+        } else {
+            System.out.println(regPark);
+            this.registriranParkiracRepository.save(regPark);
+        }
+    }
+
+    @Transactional
+    public void updateRegPark(int regParkId, String name, String surname, String mobile, String email) {
+        Optional<RegistriranParkirac> regParkOpt = Optional.ofNullable(this.registriranParkiracRepository.findByRegParkId(regParkId));
+        if (regParkOpt.isPresent()) {
+            RegistriranParkirac regParkNov = this.registriranParkiracRepository.findByRegParkId(regParkId);
+            if (email != null && email.length() > 1 && email.contains("@") && !Objects.equals(regParkNov.getEmail(), email)) {
+                Optional<RegistriranParkirac> userOpt1 = this.registriranParkiracRepository.findRegistriranParkiracByEmail(email);
+                if (userOpt1.isPresent()) {
+                    throw new IllegalStateException("email taken");
+                }
+
+                regParkNov.setEmail(email);
+            }
+
+            if (name != null && name.length() > 1 && !Objects.equals(regParkNov.getName(), name)) {
+                regParkNov.setName(name);
+            }
+
+            if (surname != null && surname.length() > 1 && !Objects.equals(regParkNov.getSurname(), surname)) {
+                regParkNov.setSurname(surname);
+            }
+
+            if (mobile != null && mobile.length() > 0 && !Objects.equals(regParkNov.getMobile(), mobile)) {
+                regParkNov.setMobile(mobile);
+            }
+        }
+    }
+
+    public void deleteRegPark(int regParkId) {
+        Optional<RegistriranParkirac> regPark = Optional.ofNullable(this.registriranParkiracRepository.findByRegParkId(regParkId));
+        if (regPark.isPresent()) {
+            this.registriranParkiracRepository.deleteByRegParkId(regParkId);
+        } else {
+            throw new IllegalStateException("RegistriranParkirac doesn't exist, therefore can't be deleted");
+        }
+    }
+
+    public RegistriranParkirac findById(int regParkId) {
+        Optional<RegistriranParkirac> regPark = Optional.ofNullable(this.registriranParkiracRepository.findByRegParkId(regParkId));
+        return regPark.orElse(null);
+    }
+}
Index: sources/app/src/main/java/parkup/services/VrabotenService.java
===================================================================
--- sources/app/src/main/java/parkup/services/VrabotenService.java	(revision ce6ad22249e902dea17e6ba473846ccebdd4330c)
+++ sources/app/src/main/java/parkup/services/VrabotenService.java	(revision ce6ad22249e902dea17e6ba473846ccebdd4330c)
@@ -0,0 +1,77 @@
+package parkup.services;
+
+import java.util.List;
+import java.util.Objects;
+import java.util.Optional;
+import java.util.UUID;
+import javax.transaction.Transactional;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import parkup.entities.Vraboten;
+import parkup.repositories.VrabotenRepository;
+
+@Service
+public class VrabotenService {
+    private final VrabotenRepository vrabotenRepository;
+
+    @Autowired
+    public VrabotenService(VrabotenRepository vrabotenRepository) {
+        this.vrabotenRepository = vrabotenRepository;
+    }
+
+    public List<Vraboten> getVraboteni() {
+        return this.vrabotenRepository.findAll();
+    }
+
+    public Vraboten findById(int vrabotenId) {
+        Optional<Vraboten> vraboten = Optional.ofNullable(this.vrabotenRepository.findByVrabotenId(vrabotenId));
+        return vraboten.orElse(null);
+    }
+
+    public void addVraboten(Vraboten vraboten) {
+        Optional<Vraboten> vrabotenOpt = this.vrabotenRepository.findVrabotenByEmail(vraboten.getEmail());
+        if (vrabotenOpt.isPresent()) {
+            throw new IllegalStateException("Email already taken, try adding a vraboten with a different valid email address");
+        } else {
+            System.out.println(vraboten);
+            this.vrabotenRepository.save(vraboten);
+        }
+    }
+
+    @Transactional
+    public void updateVraboten(int vrabotenId, String firstName, String lastName, String mobile, String email) {
+        Optional<Vraboten> vrabotenOpt = Optional.ofNullable(this.vrabotenRepository.findByVrabotenId(vrabotenId));
+        if (vrabotenOpt.isPresent()) {
+            Vraboten vrabotenNov = this.vrabotenRepository.findByVrabotenId(vrabotenId);
+            if (email != null && email.length() > 1 && email.contains("@") && !Objects.equals(vrabotenNov.getEmail(), email)) {
+                Optional<Vraboten> userOpt1 = this.vrabotenRepository.findVrabotenByEmail(email);
+                if (userOpt1.isPresent()) {
+                    throw new IllegalStateException("email taken");
+                }
+
+                vrabotenNov.setEmail(email);
+            }
+
+            if (firstName != null && firstName.length() > 1 && !Objects.equals(vrabotenNov.getFirstName(), firstName)) {
+                vrabotenNov.setFirstName(firstName);
+            }
+
+            if (lastName != null && lastName.length() > 1 && !Objects.equals(vrabotenNov.getLastName(), lastName)) {
+                vrabotenNov.setLastName(lastName);
+            }
+
+            if (mobile != null && mobile.length() > 0 && !Objects.equals(vrabotenNov.getMobile(), mobile)) {
+                vrabotenNov.setMobile(mobile);
+            }
+        }
+    }
+
+    public void deleteVraboten(int vrabotenId) {
+        Optional<Vraboten> vrabotenOpt = Optional.ofNullable(this.vrabotenRepository.findByVrabotenId(vrabotenId));
+        if (vrabotenOpt.isPresent()) {
+            this.vrabotenRepository.deleteByVrabotenId(vrabotenId);
+        } else {
+            throw new IllegalStateException("Vraboten doesn't exist, therefore can't be deleted");
+        }
+    }
+}
