Index: trip-planner/src/main/java/finki/diplomska/tripplanner/repository/jpa/JpaLocationRepository.java
===================================================================
--- trip-planner/src/main/java/finki/diplomska/tripplanner/repository/jpa/JpaLocationRepository.java	(revision eed0bf860deec9614c6d4891e655270e2bb3b8ab)
+++ trip-planner/src/main/java/finki/diplomska/tripplanner/repository/jpa/JpaLocationRepository.java	(revision 188ee53d7e92cd841a2f812afa7a47793c1280f2)
@@ -46,15 +46,34 @@
 
     @Query(value = "SELECT  * FROM locations AS l  " +
-            "LEFT JOIN recommended_companion AS rc ON l.id_location = rc.id_location " +
-            "LEFT JOIN companions AS com ON rc.id_companion = com.id_companion " +
-            "LEFT JOIN locations_belong lb ON l.id_location = lb.id_location " +
-            "LEFT JOIN categories AS cate ON lb.id_category = cate.id_category " +
-            "LEFT JOIN regions AS r" +
-            " ON l.id_region = r.id_region" +
-            " LEFT JOIN cities AS cit" +
-            " ON r.id_region = cit.id_region AND cit.id_city = l.id_city " +
-            "WHERE cit.id_city = :locationId and com.id_companion = :companionId and cate.id_category in (:categories) " +
-            "GROUP BY l.id_location " +
-            "ORDER BY CASE l.priority WHEN 'high' THEN 1 WHEN 'medium' THEN 2 WHEN 'low' THEN 3 END", nativeQuery = true)
-    List<Location> findLocationsFromForm(@Param("locationId") Long locationId, @Param("companionId") Long companionId, @Param("categories") List<Long> categories);
+            "LEFT JOIN recommended_companion AS rc " +
+            "ON l.id_location = rc.id_location " +
+            "LEFT JOIN companions AS companion " +
+            "ON rc.id_companion = companion.id_companion " +
+            "LEFT JOIN locations_belong lb " +
+            "ON l.id_location = lb.id_location " +
+            "LEFT JOIN categories AS category " +
+            "ON lb.id_category = category.id_category " +
+            "LEFT JOIN cities AS city " +
+            "ON city.id_city = l.id_city " +
+            "WHERE city.id_city = :cityId and companion.id_companion = :companionId and category.id_category IN (:categoryIds) " +
+            "GROUP BY l.id_location ORDER BY CASE l.priority WHEN 'high' THEN 1 WHEN 'medium' THEN 2 WHEN 'low' THEN 3 END", nativeQuery = true)
+    List<Location> findLocationsFromCityForm(@Param("cityId") Long cityId, @Param("companionId") Long companionId, @Param("categoryIds") List<Long> categoryIds);
+
+    @Query(value="SELECT * FROM locations AS location " +
+            "LEFT JOIN recommended_companion AS rc " +
+            "ON location.id_location = rc.id_location " +
+            "LEFT JOIN companions AS companion " +
+            "ON rc.id_companion = companion.id_companion " +
+            "LEFT JOIN locations_belong lb " +
+            "ON location.id_location = lb.id_location " +
+            "LEFT JOIN categories AS category " +
+            "ON lb.id_category = category.id_category " +
+            "LEFT JOIN regions AS region " +
+            "ON location.id_region = region.id_region " +
+            "LEFT JOIN cities AS city " +
+            "ON region.id_region  = city.id_region " +
+            "AND city.id_city = location.id_city " +
+            "WHERE region.id_region = :regionId AND companion.id_companion  = :companionId AND category.id_category  IN (:categoryIds) " +
+            "GROUP BY location.id_location ORDER BY CASE location.priority WHEN 'high' THEN 1 WHEN 'medium' THEN 2 WHEN 'low' THEN 3 END", nativeQuery = true)
+    List<Location> findLocationsFromRegionForm(@Param("regionId") Long regionId, @Param("companionId") Long companionId, @Param("categoryIds") List<Long> categoryIds);
 }
Index: trip-planner/src/main/java/finki/diplomska/tripplanner/service/LocationService.java
===================================================================
--- trip-planner/src/main/java/finki/diplomska/tripplanner/service/LocationService.java	(revision eed0bf860deec9614c6d4891e655270e2bb3b8ab)
+++ trip-planner/src/main/java/finki/diplomska/tripplanner/service/LocationService.java	(revision 188ee53d7e92cd841a2f812afa7a47793c1280f2)
@@ -10,10 +10,10 @@
 public interface LocationService {
     List<Location> findLocationsFromCity(String locName, String companion, List<String> categories);
+    List<Location> findLocationsFromCountry (String locName, String companion,String region, List<String> categories );
     List<Location> findAll();
     Location getById(Long id);
-    List<Location> findLocationsFromCountry (String locName, String companion,String region, List<String> categories );
     List<Location> scheduleLocations(String locName, String companion,String region, List<String> categories, int numberOfDays);
     Optional<Location> findById(Long id);
-
-    List<Location> findLocations(Long locationId, Long companionId, Long lengthOfStay, String categoryIds);
+    List<Location> findLocationsFromCityForm(Long cityId, Long companionId, Long lengthOfStay, String categoryIds);
+    List<Location> findLocationsFromRegionForm(Long regionId, Long companionId, Long lengthOfStay, String categoryIds);
 }
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 eed0bf860deec9614c6d4891e655270e2bb3b8ab)
+++ trip-planner/src/main/java/finki/diplomska/tripplanner/service/impl/LocationServiceImpl.java	(revision 188ee53d7e92cd841a2f812afa7a47793c1280f2)
@@ -50,5 +50,5 @@
 
     @Override
-    public List<Location> findLocations(Long locationId, Long companionId, Long lengthOfStay, String categoryIds) {
+    public List<Location> findLocationsFromCityForm(Long cityId, Long companionId, Long lengthOfStay, String categoryIds) {
         List<Long> categories = null;
         if(categoryIds != null && !categoryIds.isEmpty()){
@@ -56,7 +56,56 @@
             categories = ids.stream().map(Long::valueOf).collect(Collectors.toList());
         }
-        List<Location> foundLocations = locationRepository.findLocationsFromForm(locationId, companionId, categories);
-        return foundLocations;
+        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
Index: trip-planner/src/main/java/finki/diplomska/tripplanner/web/rest/LocationRestController.java
===================================================================
--- trip-planner/src/main/java/finki/diplomska/tripplanner/web/rest/LocationRestController.java	(revision eed0bf860deec9614c6d4891e655270e2bb3b8ab)
+++ trip-planner/src/main/java/finki/diplomska/tripplanner/web/rest/LocationRestController.java	(revision 188ee53d7e92cd841a2f812afa7a47793c1280f2)
@@ -34,16 +34,19 @@
     }
 
-    @GetMapping(value = "/trip/locations")
-    public List<Location> allLocationsAfterSubmittedForm(@RequestParam(required = false) Long locationId,
+    @GetMapping(value = "/city/locations")
+    public List<Location> getAllLocationsFromCity(@RequestParam(required = false) Long cityId,
                                                          @RequestParam(required = false)  Long companionId,
                                                          @RequestParam(required = false) Long lengthOfStay,
                                                          @RequestParam(required = false) String categoryIds)  {
-        return this.locationService.findLocations(locationId, companionId, lengthOfStay, categoryIds);
-        /* List<Location> generatedLocations = this.locationService.scheduleLocations(locName, companion, region, categories, numberOfDays);
-        if(locName.equals("Macedonia")){
-            return generatedLocations;
-        }else{
-            return generatedLocations;
-        }*/
+        return this.locationService.findLocationsFromCityForm(cityId, companionId, lengthOfStay, categoryIds);
+
+    }
+
+    @GetMapping(value = "/region/locations")
+    public List<Location> getAllLocationsFromRegion(@RequestParam(required = false) Long regionId,
+                                                    @RequestParam(required = false)  Long companionId,
+                                                    @RequestParam(required = false) Long lengthOfStay,
+                                                    @RequestParam(required = false) String categoryIds){
+        return this.locationService.findLocationsFromRegionForm(regionId, companionId,lengthOfStay, categoryIds);
     }
 }
