Index: trip-planner/src/main/java/finki/diplomska/tripplanner/service/impl/CustomUserDetailsServiceImpl.java
===================================================================
--- trip-planner/src/main/java/finki/diplomska/tripplanner/service/impl/CustomUserDetailsServiceImpl.java	(revision 571e0df9a7a5e798c9941a85842f785177bedbbd)
+++ 	(revision )
@@ -1,34 +1,0 @@
-package finki.diplomska.tripplanner.service.impl;
-
-import finki.diplomska.tripplanner.models.User;
-import finki.diplomska.tripplanner.repository.jpa.JpaUserRepository;
-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.stereotype.Service;
-
-import javax.transaction.Transactional;
-
-@Service
-public class CustomUserDetailsServiceImpl implements UserDetailsService {
-
-    @Autowired
-    private JpaUserRepository userRepository;
-
-    @Override
-    public UserDetails loadUserByUsername(String username) throws UsernameNotFoundException {
-        User user = userRepository.findByUsername(username);
-        if(user==null) new UsernameNotFoundException("User not found");
-        return user;
-    }
-
-
-    @Transactional
-    public User loadUserById(Long id){
-        User user = userRepository.getById(id);
-        if(user==null) new UsernameNotFoundException("User not found");
-        return user;
-
-    }
-}
Index: trip-planner/src/main/java/finki/diplomska/tripplanner/service/impl/ImagesServiceImpl.java
===================================================================
--- trip-planner/src/main/java/finki/diplomska/tripplanner/service/impl/ImagesServiceImpl.java	(revision 571e0df9a7a5e798c9941a85842f785177bedbbd)
+++ 	(revision )
@@ -1,23 +1,0 @@
-package finki.diplomska.tripplanner.service.impl;
-
-import finki.diplomska.tripplanner.models.Images;
-import finki.diplomska.tripplanner.repository.jpa.JpaImageRepository;
-import finki.diplomska.tripplanner.service.ImagesService;
-import org.springframework.stereotype.Service;
-
-import java.util.List;
-
-@Service
-public class ImagesServiceImpl implements ImagesService {
-
-    private final JpaImageRepository jpaImageRepository;
-
-    public ImagesServiceImpl(JpaImageRepository jpaImageRepository) {
-        this.jpaImageRepository = jpaImageRepository;
-    }
-
-    @Override
-    public List<Images> getAllImagesForLocation(Long locationId) {
-        return this.jpaImageRepository.getAllImagesForLocation(locationId);
-    }
-}
Index: trip-planner/src/main/java/finki/diplomska/tripplanner/service/impl/LocationServiceImpl.java
===================================================================
--- trip-planner/src/main/java/finki/diplomska/tripplanner/service/impl/LocationServiceImpl.java	(revision 571e0df9a7a5e798c9941a85842f785177bedbbd)
+++ trip-planner/src/main/java/finki/diplomska/tripplanner/service/impl/LocationServiceImpl.java	(revision 6a3a178323fd905112b5392bd9d3cb83b66ef2d3)
@@ -1,17 +1,11 @@
 package finki.diplomska.tripplanner.service.impl;
 
-import finki.diplomska.tripplanner.models.*;
-import finki.diplomska.tripplanner.models.dto.LocationDto;
-import finki.diplomska.tripplanner.models.dto.PlannerLocationDto;
-import finki.diplomska.tripplanner.models.exceptions.CityNotFoundException;
-import finki.diplomska.tripplanner.models.exceptions.CompanionNotFoundException;
+import finki.diplomska.tripplanner.models.Location;
 import finki.diplomska.tripplanner.models.exceptions.LocationNotFoundException;
-import finki.diplomska.tripplanner.models.exceptions.RegionNotFoundException;
-import finki.diplomska.tripplanner.repository.jpa.*;
+import finki.diplomska.tripplanner.repository.jpa.JpaLocationRepository;
 import finki.diplomska.tripplanner.service.LocationService;
 import org.springframework.stereotype.Service;
 
 import java.util.*;
-import java.util.stream.Collectors;
 
 
@@ -20,19 +14,7 @@
 
     private final JpaLocationRepository locationRepository;
-    private final JpaPlannerRepository plannerRepository;
-    private final JpaRegionRepository regionRepository;
-    private final JpaCityRepository cityRepository;
-    private final JpaUserRepository userRepository;
-    private final JpaCategoryRepository categoryRepository;
-    private final JpaCompanionRepository companionRepository;
 
-    public LocationServiceImpl(JpaLocationRepository locationRepository, JpaPlannerRepository plannerRepository, JpaRegionRepository regionRepository, JpaCityRepository cityRepository, JpaUserRepository userRepository, JpaCategoryRepository categoryRepository, JpaCompanionRepository companionRepository) {
+    public LocationServiceImpl(JpaLocationRepository locationRepository) {
         this.locationRepository = locationRepository;
-        this.plannerRepository = plannerRepository;
-        this.regionRepository = regionRepository;
-        this.cityRepository = cityRepository;
-        this.userRepository = userRepository;
-        this.categoryRepository = categoryRepository;
-        this.companionRepository = companionRepository;
     }
 
@@ -65,64 +47,4 @@
         return this.locationRepository.findById(id);
     }
-
-    @Override
-    public List<Location> findLocationsFromCityForm(Long cityId, Long companionId, Long lengthOfStay, String categoryIds) {
-        List<Long> categories = null;
-        if(categoryIds != null && !categoryIds.isEmpty()){
-            List<String> ids = Arrays.asList(categoryIds.split(","));
-            categories = ids.stream().map(Long::valueOf).collect(Collectors.toList());
-        }
-        Long maxMinutesPerDay = lengthOfStay *6 * 60;
-        int minutesPerDay = 0;
-        List<Location> citylocations = this.locationRepository.findLocationsFromCityForm(cityId, companionId, categories);
-        List<Location> newList = new ArrayList<>();
-        int listSize = citylocations.size();
-
-        while(minutesPerDay < maxMinutesPerDay ){
-            for(Location l: citylocations) {
-                if (minutesPerDay < maxMinutesPerDay && l.getDuration() + minutesPerDay <= maxMinutesPerDay && listSize != 0) {
-                    newList.add(l);
-                    listSize --;
-                }
-                minutesPerDay += l.getDuration();
-                if (minutesPerDay > maxMinutesPerDay) {
-                    break;
-                }
-            }
-        }
-
-        List<Location> foundLocations = locationRepository.findLocationsFromCityForm(cityId, companionId, categories);
-        return newList;
-    }
-
-    @Override
-    public List<Location> findLocationsFromRegionForm(Long regionId, Long companionId, Long lengthOfStay, String categoryIds) {
-        List<Long> categories = null;
-        if(categoryIds != null && !categoryIds.isEmpty()){
-            List<String> ids = Arrays.asList(categoryIds.split(","));
-            categories = ids.stream().map(Long::valueOf).collect(Collectors.toList());
-        }
-        Long maxMinutesPerDay = lengthOfStay *6 * 60;
-        int minutesPerDay = 0;
-        List<Location> countryLocations = this.locationRepository.findLocationsFromRegionForm(regionId, companionId, categories);
-        List<Location> newList = new ArrayList<>();
-        int listCountrySize = countryLocations.size();
-
-            while(minutesPerDay < maxMinutesPerDay){
-                for(Location l: countryLocations) {
-                    if (minutesPerDay < maxMinutesPerDay && l.getDuration() + minutesPerDay <= maxMinutesPerDay && listCountrySize != 0) {
-                        newList.add(l);
-                        listCountrySize --;
-                    }
-                    minutesPerDay += l.getDuration();
-                    if (minutesPerDay > maxMinutesPerDay) {
-                        break;
-                    }
-                }
-
-        }
-        return newList;
-    }
-
 
     @Override
@@ -163,57 +85,7 @@
             }
         }
+
         return newList;
     }
 
-    @Override
-    public Location addLocationToPlanner(PlannerLocationDto plannerLocationDto) {
-        Location location = this.locationRepository.findById(plannerLocationDto.getLocationId())
-                .orElseThrow(() -> new LocationNotFoundException(plannerLocationDto.getLocationId()));
-        Planner planner = this.plannerRepository.getById(plannerLocationDto.getPlannerId());
-        planner.getLocationList().add(location);
-        return this.locationRepository.save(location);
-    }
-
-    @Override
-    public List<Location> getAllLocationsForPlanner(Long plannerId) {
-        return this.locationRepository.getAllLocationsForPlanner(plannerId);
-    }
-
-    @Override
-    public List<Location> getWeekendGetaways() {
-        return this.locationRepository.getWeekendGetaways();
-    }
-
-    @Override
-    public List<Location> getVillages() {
-        return this.locationRepository.getVillages();
-    }
-
-    @Override
-    public List<Long> getAllLocationIdsForPlanner(Long plannerId) {
-        return this.locationRepository.getAllLocationIdsForPlanner(plannerId);
-    }
-
-    @Override
-    public List<Location> getAllLocations(String place) {
-        return this.locationRepository.getAllLocations(place);
-    }
-
-    @Override
-    public Optional<Location> save(LocationDto locationDto, String username) {
-        City city = new City();
-        Region region = this.regionRepository.findById(locationDto.getRegion())
-                .orElseThrow(() -> new RegionNotFoundException(locationDto.getRegion()));
-        if(locationDto.getCity() != null){
-             city = this.cityRepository.findById(locationDto.getCity())
-                    .orElseThrow(() -> new CityNotFoundException(locationDto.getCity()));
-        }else{
-            city = null;
-        }
-        User user = this.userRepository.findByUsername(username);
-        locationDto.setUser(user.getUsername());
-        return Optional.of(this.locationRepository.save(new Location(locationDto.getName(), locationDto.getDescription(), locationDto.getAddress(), locationDto.getPriority(),
-                locationDto.getDuration(), locationDto.getTrivia(), locationDto.getPhoto(), region, city, user)));
-    }
-
 }
Index: trip-planner/src/main/java/finki/diplomska/tripplanner/service/impl/MapValidationErrorService.java
===================================================================
--- trip-planner/src/main/java/finki/diplomska/tripplanner/service/impl/MapValidationErrorService.java	(revision 571e0df9a7a5e798c9941a85842f785177bedbbd)
+++ 	(revision )
@@ -1,28 +1,0 @@
-package finki.diplomska.tripplanner.service.impl;
-
-import org.springframework.http.HttpStatus;
-import org.springframework.http.ResponseEntity;
-import org.springframework.stereotype.Service;
-import org.springframework.validation.BindingResult;
-import org.springframework.validation.FieldError;
-
-import java.util.HashMap;
-import java.util.Map;
-
-@Service
-public class MapValidationErrorService {
-    public ResponseEntity<?> MapValidationService(BindingResult result){
-
-        if(result.hasErrors()){
-            Map<String, String> errorMap = new HashMap<>();
-
-            for(FieldError error: result.getFieldErrors()){
-                errorMap.put(error.getField(), error.getDefaultMessage());
-            }
-            return new ResponseEntity<Map<String, String>>(errorMap, HttpStatus.BAD_REQUEST);
-        }
-
-        return null;
-
-    }
-}
Index: trip-planner/src/main/java/finki/diplomska/tripplanner/service/impl/PlannerServiceImpl.java
===================================================================
--- trip-planner/src/main/java/finki/diplomska/tripplanner/service/impl/PlannerServiceImpl.java	(revision 571e0df9a7a5e798c9941a85842f785177bedbbd)
+++ trip-planner/src/main/java/finki/diplomska/tripplanner/service/impl/PlannerServiceImpl.java	(revision 6a3a178323fd905112b5392bd9d3cb83b66ef2d3)
@@ -3,16 +3,15 @@
 import finki.diplomska.tripplanner.models.Location;
 import finki.diplomska.tripplanner.models.Planner;
-import finki.diplomska.tripplanner.models.User;
 import finki.diplomska.tripplanner.models.dto.PlannerDto;
-import finki.diplomska.tripplanner.models.dto.PlannerLocationDto;
 import finki.diplomska.tripplanner.models.exceptions.LocationNotFoundException;
 import finki.diplomska.tripplanner.models.exceptions.PlannerNotFoundException;
 import finki.diplomska.tripplanner.repository.jpa.JpaLocationRepository;
 import finki.diplomska.tripplanner.repository.jpa.JpaPlannerRepository;
-import finki.diplomska.tripplanner.repository.jpa.JpaUserRepository;
+import finki.diplomska.tripplanner.service.LocationService;
 import finki.diplomska.tripplanner.service.PlannerService;
-import org.springframework.http.ResponseEntity;
 import org.springframework.stereotype.Service;
+import reactor.util.annotation.Nullable;
 
+import java.util.ArrayList;
 import java.util.List;
 import java.util.Optional;
@@ -23,10 +22,10 @@
     private final JpaPlannerRepository plannerRepository;
     private final JpaLocationRepository locationRepository;
-    private final JpaUserRepository userRepository;
+    private final LocationService locationService;
 
-    public PlannerServiceImpl(JpaPlannerRepository plannerRepository, JpaLocationRepository locationRepository, JpaUserRepository userRepository) {
+    public PlannerServiceImpl(JpaPlannerRepository plannerRepository, JpaLocationRepository locationRepository, LocationService locationService) {
         this.plannerRepository = plannerRepository;
         this.locationRepository = locationRepository;
-        this.userRepository = userRepository;
+        this.locationService = locationService;
     }
 
@@ -37,18 +36,19 @@
 
     @Override
-    public List<Planner> getPlannersByUser(String username) {
-        User user = this.userRepository.findByUsername(username);
-        return this.plannerRepository.getPlannersByUser(user.getUsername());
-    }
-
-    @Override
     public Optional<Planner> findById(Long id) {
         return this.plannerRepository.findById(id);
     }
 
+    @Override
+    public Planner addLocationToPlanner(Long plannerId, Long locationId) {
+        Location location = this.locationService.findById(locationId)
+                .orElseThrow(() -> new LocationNotFoundException(locationId));
+        Planner planner = this.plannerRepository.getById(plannerId);
+        planner.getLocationList().add(location);
+        return this.plannerRepository.save(planner);
+    }
 
     @Override
-    public Optional<Planner> newPlanner(PlannerDto plannerDto, String username) {
-        /*
+    public Optional<Planner> newPlanner(PlannerDto plannerDto) {
         List<Location> locationList  = new ArrayList<>();
         for(Long location : plannerDto.getLocationList()){
@@ -57,19 +57,5 @@
             locationList.add(loc);
         }
-         */
-        User user = this.userRepository.findByUsername(username);
-        plannerDto.setUser(user.getUsername());
-        return Optional.of(this.plannerRepository.save(new Planner(plannerDto.getName(), plannerDto.getDescription(), null, user)));
-    }
-
-    @Override
-    public void deletePlannerById(Long id) {
-        this.plannerRepository.deleteById(id);
-    }
-
-    @Override
-    public ResponseEntity deleteLocationFromPlanner(PlannerLocationDto plannerLocationDto) {
-        plannerRepository.deleteLocationFromPlanner(plannerLocationDto.getPlannerId(), plannerLocationDto.getLocationId());
-        return null;
+        return Optional.of(this.plannerRepository.save(new Planner(plannerDto.getName(), plannerDto.getDescription(),  locationList)));
     }
 
@@ -90,13 +76,10 @@
 
     @Override
-    public Optional<Planner> editPlanner(Long id, PlannerDto plannerDto, String username) {
+    public Optional<Planner> editPlanner(Long id, PlannerDto plannerDto) {
         Planner planner = this.plannerRepository.findById(id).orElseThrow(() -> new PlannerNotFoundException(id));
-        User user = this.userRepository.findByUsername(username);
 
         planner.setName(plannerDto.getName());
         planner.setDescription(plannerDto.getDescription());
-        plannerDto.setUser(user.getUsername());
-        planner.setUser(user);
-/*
+
         List<Location> locationList  = new ArrayList<>();
         for(Long location : plannerDto.getLocationList()){
@@ -106,6 +89,4 @@
         }
         planner.setLocationList(locationList);
-
- */
         return Optional.of(this.plannerRepository.save(planner));
     }
Index: trip-planner/src/main/java/finki/diplomska/tripplanner/service/impl/RegionServiceImpl.java
===================================================================
--- trip-planner/src/main/java/finki/diplomska/tripplanner/service/impl/RegionServiceImpl.java	(revision 571e0df9a7a5e798c9941a85842f785177bedbbd)
+++ trip-planner/src/main/java/finki/diplomska/tripplanner/service/impl/RegionServiceImpl.java	(revision 6a3a178323fd905112b5392bd9d3cb83b66ef2d3)
@@ -21,8 +21,3 @@
         return this.regionRepository.findAll();
     }
-
-    @Override
-    public List<String> getAllCitiesAndRegions() {
-        return this.regionRepository.getAllCitiesAndRegions();
-    }
 }
Index: trip-planner/src/main/java/finki/diplomska/tripplanner/service/impl/UserServiceImpl.java
===================================================================
--- trip-planner/src/main/java/finki/diplomska/tripplanner/service/impl/UserServiceImpl.java	(revision 571e0df9a7a5e798c9941a85842f785177bedbbd)
+++ 	(revision )
@@ -1,56 +1,0 @@
-package finki.diplomska.tripplanner.service.impl;
-
-import finki.diplomska.tripplanner.models.User;
-import finki.diplomska.tripplanner.models.dto.UserDto;
-import finki.diplomska.tripplanner.models.exceptions.UsernameAlreadyExistsException;
-import finki.diplomska.tripplanner.repository.jpa.JpaUserRepository;
-import finki.diplomska.tripplanner.service.UserService;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.http.ResponseEntity;
-import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
-import org.springframework.stereotype.Service;
-
-import java.util.List;
-import java.util.Optional;
-
-
-@Service
-public class UserServiceImpl  implements UserService {
-
-    @Autowired
-    private JpaUserRepository userRepository;
-
-    @Autowired
-    private BCryptPasswordEncoder bCryptPasswordEncoder;
-
-    public User saveUser (User newUser){
-        try{
-            newUser.setPassword(bCryptPasswordEncoder.encode(newUser.getPassword()));
-            //Username has to be unique (exception)
-            newUser.setUsername(newUser.getUsername());
-            // Make sure that password and confirmPassword match
-            // We don't persist or show the confirmPassword
-            newUser.setConfirmPassword("");
-             return this.userRepository.save(newUser);
-        }catch(Exception e){
-            throw new UsernameAlreadyExistsException("Username '"+newUser.getUsername()+ "' already exists");
-        }
-    }
-
-    @Override
-    public List<String> getAllUsernames() {
-        return this.userRepository.getAllUsernames();
-    }
-
-    @Override
-    public Optional<String> getPassword(UserDto userDto) {
-         this.userRepository.getPassword(userDto.getUsername());
-         return null;
-    }
-
-    @Override
-    public Optional<User> findById(Long id) {
-        return this.userRepository.findById(id);
-    }
-
-}
