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 6a3a178323fd905112b5392bd9d3cb83b66ef2d3)
+++ trip-planner/src/main/java/finki/diplomska/tripplanner/repository/jpa/JpaLocationRepository.java	(revision eed0bf860deec9614c6d4891e655270e2bb3b8ab)
@@ -44,3 +44,17 @@
             "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> findLocationsFromCountry(@Param("locName") String ime, @Param("companion") String companion, @Param("region") String region, @Param("categories") List<String> categories);
+
+    @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);
 }
Index: trip-planner/src/main/java/finki/diplomska/tripplanner/service/LocationService.java
===================================================================
--- trip-planner/src/main/java/finki/diplomska/tripplanner/service/LocationService.java	(revision 6a3a178323fd905112b5392bd9d3cb83b66ef2d3)
+++ trip-planner/src/main/java/finki/diplomska/tripplanner/service/LocationService.java	(revision eed0bf860deec9614c6d4891e655270e2bb3b8ab)
@@ -15,3 +15,5 @@
     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);
 }
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 6a3a178323fd905112b5392bd9d3cb83b66ef2d3)
+++ trip-planner/src/main/java/finki/diplomska/tripplanner/service/impl/LocationServiceImpl.java	(revision eed0bf860deec9614c6d4891e655270e2bb3b8ab)
@@ -8,4 +8,5 @@
 
 import java.util.*;
+import java.util.stream.Collectors;
 
 
@@ -46,4 +47,15 @@
     public Optional<Location> findById(Long id) {
         return this.locationRepository.findById(id);
+    }
+
+    @Override
+    public List<Location> findLocations(Long locationId, 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());
+        }
+        List<Location> foundLocations = locationRepository.findLocationsFromForm(locationId, companionId, categories);
+        return foundLocations;
     }
 
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 6a3a178323fd905112b5392bd9d3cb83b66ef2d3)
+++ trip-planner/src/main/java/finki/diplomska/tripplanner/web/rest/LocationRestController.java	(revision eed0bf860deec9614c6d4891e655270e2bb3b8ab)
@@ -34,16 +34,16 @@
     }
 
-    @PostMapping(value = "/trip/locations")
-    public List<Location> allLocationsAfterSubmittedForm(@RequestParam(required = false) String locName,
-                                                         @RequestParam(required = false)  String companion,
-                                                         @RequestParam(required = false) String region,
-                                                         @RequestParam(required = false) List<String> categories,
-                                                         @RequestParam(required = false)  int numberOfDays)  {
-        List<Location> generatedLocations = this.locationService.scheduleLocations(locName, companion, region, categories, numberOfDays);
+    @GetMapping(value = "/trip/locations")
+    public List<Location> allLocationsAfterSubmittedForm(@RequestParam(required = false) Long locationId,
+                                                         @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;
-        }
+        }*/
     }
 }
Index: trip-planner/src/test/api.http
===================================================================
--- trip-planner/src/test/api.http	(revision 6a3a178323fd905112b5392bd9d3cb83b66ef2d3)
+++ trip-planner/src/test/api.http	(revision eed0bf860deec9614c6d4891e655270e2bb3b8ab)
@@ -30,5 +30,5 @@
 
 ###
-POST http://localhost:8080/api/trip/locations
+GET http://localhost:8080/api/trip/locations
 Content-Type: application/x-www-form-urlencoded
 
