Index: springapp/src/main/java/mk/profesori/springapp/Controller/MainController.java
===================================================================
--- springapp/src/main/java/mk/profesori/springapp/Controller/MainController.java	(revision 0e62f4dd2d93ff67c2c87c7e6f631bfc12bfb784)
+++ springapp/src/main/java/mk/profesori/springapp/Controller/MainController.java	(revision 7cb8c3c8e176ea1118e2a936b1b3c7a82323b6a9)
@@ -5,4 +5,5 @@
 
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.CrossOrigin;
 import org.springframework.web.bind.annotation.PathVariable;
 import org.springframework.web.bind.annotation.RequestMapping;
@@ -19,4 +20,5 @@
 
 @RestController
+@CrossOrigin(origins = "http://192.168.0.17:3000")
 public class MainController {
     
Index: springapp/src/main/java/mk/profesori/springapp/Model/City.java
===================================================================
--- springapp/src/main/java/mk/profesori/springapp/Model/City.java	(revision 0e62f4dd2d93ff67c2c87c7e6f631bfc12bfb784)
+++ springapp/src/main/java/mk/profesori/springapp/Model/City.java	(revision 7cb8c3c8e176ea1118e2a936b1b3c7a82323b6a9)
@@ -12,8 +12,10 @@
 import javax.persistence.Table;
 
-import com.fasterxml.jackson.annotation.JsonManagedReference;
+import com.fasterxml.jackson.annotation.JsonIdentityInfo;
+import com.fasterxml.jackson.annotation.ObjectIdGenerators;
 
 @Entity
 @Table(name = "city")
+@JsonIdentityInfo(generator = ObjectIdGenerators.PropertyGenerator.class, property = "cityId")
 public class City {
 
@@ -29,5 +31,5 @@
     private Set<University> universities = new HashSet<>();
 
-    //getters
+    // getters
     public Long getCityId() {
         return cityId;
@@ -38,8 +40,7 @@
     }
 
-    @JsonManagedReference
     public Set<University> getUniversities() {
         return universities;
     }
-    
+
 }
Index: springapp/src/main/java/mk/profesori/springapp/Model/CustomUserDetails.java
===================================================================
--- springapp/src/main/java/mk/profesori/springapp/Model/CustomUserDetails.java	(revision 0e62f4dd2d93ff67c2c87c7e6f631bfc12bfb784)
+++ springapp/src/main/java/mk/profesori/springapp/Model/CustomUserDetails.java	(revision 7cb8c3c8e176ea1118e2a936b1b3c7a82323b6a9)
@@ -22,5 +22,6 @@
 import org.springframework.security.core.userdetails.UserDetails;
 
-import com.fasterxml.jackson.annotation.JsonManagedReference;
+import com.fasterxml.jackson.annotation.JsonIdentityInfo;
+import com.fasterxml.jackson.annotation.ObjectIdGenerators;
 
 import lombok.EqualsAndHashCode;
@@ -34,4 +35,5 @@
 @NoArgsConstructor
 @Entity
+@JsonIdentityInfo(generator = ObjectIdGenerators.PropertyGenerator.class, property = "id")
 public class CustomUserDetails implements UserDetails {
 
@@ -40,5 +42,5 @@
     @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "user_sequence")
     private Long id;
-    private String fullName; //opcionalno, smee da e prazno
+    private String fullName; // opcionalno, smee da e prazno
     private String username;
     private String email;
@@ -97,8 +99,7 @@
     }
 
-    @JsonManagedReference
     List<Post> getAuthoredPosts() {
         return this.authoredPosts;
     }
-    
+
 }
Index: springapp/src/main/java/mk/profesori/springapp/Model/Faculty.java
===================================================================
--- springapp/src/main/java/mk/profesori/springapp/Model/Faculty.java	(revision 0e62f4dd2d93ff67c2c87c7e6f631bfc12bfb784)
+++ springapp/src/main/java/mk/profesori/springapp/Model/Faculty.java	(revision 7cb8c3c8e176ea1118e2a936b1b3c7a82323b6a9)
@@ -14,9 +14,10 @@
 import javax.persistence.Table;
 
-import com.fasterxml.jackson.annotation.JsonBackReference;
-import com.fasterxml.jackson.annotation.JsonManagedReference;
+import com.fasterxml.jackson.annotation.JsonIdentityInfo;
+import com.fasterxml.jackson.annotation.ObjectIdGenerators;
 
 @Entity
 @Table(name = "faculty")
+@JsonIdentityInfo(generator = ObjectIdGenerators.PropertyGenerator.class, property = "facultyId")
 public class Faculty {
 
@@ -39,5 +40,5 @@
     private Set<StudyProgramme> studyProgrammes = new HashSet<>();
 
-    //getters
+    // getters
     public Long getFacultyId() {
         return facultyId;
@@ -48,18 +49,15 @@
     }
 
-    @JsonBackReference
     public University getUniversity() {
         return university;
     }
 
-    @JsonManagedReference
     public Set<Professor> getProfessors() {
         return professors;
     }
 
-    @JsonManagedReference
     public Set<StudyProgramme> getStudyProgrammes() {
         return studyProgrammes;
     }
-    
+
 }
Index: springapp/src/main/java/mk/profesori/springapp/Model/Opinion.java
===================================================================
--- springapp/src/main/java/mk/profesori/springapp/Model/Opinion.java	(revision 0e62f4dd2d93ff67c2c87c7e6f631bfc12bfb784)
+++ springapp/src/main/java/mk/profesori/springapp/Model/Opinion.java	(revision 7cb8c3c8e176ea1118e2a936b1b3c7a82323b6a9)
@@ -9,9 +9,7 @@
 import javax.persistence.ManyToOne;
 
-import com.fasterxml.jackson.annotation.JsonBackReference;
-
 @Entity
 @DiscriminatorValue("opinion")
-public class Opinion extends Post{
+public class Opinion extends Post {
 
     @ManyToOne
@@ -26,6 +24,5 @@
     }
 
-    //getters and setters
-    @JsonBackReference
+    // getters and setters
     public Professor getTargetProfessor() {
         return targetProfessor;
Index: springapp/src/main/java/mk/profesori/springapp/Model/Post.java
===================================================================
--- springapp/src/main/java/mk/profesori/springapp/Model/Post.java	(revision 0e62f4dd2d93ff67c2c87c7e6f631bfc12bfb784)
+++ springapp/src/main/java/mk/profesori/springapp/Model/Post.java	(revision 7cb8c3c8e176ea1118e2a936b1b3c7a82323b6a9)
@@ -19,28 +19,28 @@
 import javax.persistence.OneToMany;
 
-import com.fasterxml.jackson.annotation.JsonBackReference;
-import com.fasterxml.jackson.annotation.JsonManagedReference;
+import com.fasterxml.jackson.annotation.JsonIdentityInfo;
+import com.fasterxml.jackson.annotation.ObjectIdGenerators;
 
-@Entity(name="post")
+@Entity(name = "post")
 @Inheritance(strategy = InheritanceType.SINGLE_TABLE)
-@DiscriminatorColumn(name="post_type", 
-  discriminatorType = DiscriminatorType.STRING)
+@DiscriminatorColumn(name = "post_type", discriminatorType = DiscriminatorType.STRING)
+@JsonIdentityInfo(generator = ObjectIdGenerators.PropertyGenerator.class, property = "postId")
 public class Post {
-    
+
     @Id
     @GeneratedValue(strategy = GenerationType.IDENTITY)
     @Column(name = "id")
     private Long postId;
-    
+
     @Column(name = "title")
     private String title;
 
-    @Column(name = "content", columnDefinition="TEXT")
+    @Column(name = "content", columnDefinition = "TEXT")
     private String content;
-    
+
     @ManyToOne
     @JoinColumn(name = "custom_user_details_id")
     private CustomUserDetails author;
-    
+
     @Column(name = "time_posted")
     private LocalDateTime timePosted;
@@ -58,9 +58,9 @@
     @JoinColumn(name = "parent_post_id", nullable = true)
     private Post parent;
-    
+
     @OneToMany(mappedBy = "parent", cascade = CascadeType.ALL)
     private List<Post> children = new ArrayList<>();
 
-    //getters and setters
+    // getters and setters
     public Long getPostId() {
         return postId;
@@ -86,6 +86,5 @@
         this.content = content;
     }
-    
-    @JsonBackReference
+
     public CustomUserDetails getAuthor() {
         return author;
@@ -128,5 +127,4 @@
     }
 
-    @JsonBackReference
     public Post getParent() {
         return parent;
@@ -137,5 +135,4 @@
     }
 
-    @JsonManagedReference
     public List<Post> getChildren() {
         return children;
@@ -160,4 +157,4 @@
         this.children = children;
     }
-    
+
 }
Index: springapp/src/main/java/mk/profesori/springapp/Model/Professor.java
===================================================================
--- springapp/src/main/java/mk/profesori/springapp/Model/Professor.java	(revision 0e62f4dd2d93ff67c2c87c7e6f631bfc12bfb784)
+++ springapp/src/main/java/mk/profesori/springapp/Model/Professor.java	(revision 7cb8c3c8e176ea1118e2a936b1b3c7a82323b6a9)
@@ -2,8 +2,5 @@
 
 import java.util.ArrayList;
-import java.util.HashSet;
 import java.util.List;
-import java.util.Set;
-
 import javax.persistence.CascadeType;
 import javax.persistence.Column;
@@ -17,9 +14,10 @@
 import javax.persistence.Table;
 
-import com.fasterxml.jackson.annotation.JsonBackReference;
-import com.fasterxml.jackson.annotation.JsonManagedReference;
+import com.fasterxml.jackson.annotation.JsonIdentityInfo;
+import com.fasterxml.jackson.annotation.ObjectIdGenerators;
 
 @Entity
 @Table(name = "professor")
+@JsonIdentityInfo(generator = ObjectIdGenerators.PropertyGenerator.class, property = "professorId")
 public class Professor {
 
@@ -39,5 +37,5 @@
     private List<Opinion> relatedOpinions = new ArrayList<Opinion>();
 
-    //getters
+    // getters
     public Long getProfessorId() {
         return professorId;
@@ -48,10 +46,8 @@
     }
 
-    @JsonBackReference
     public Faculty getFaculty() {
         return faculty;
     }
 
-    @JsonManagedReference
     public List<Opinion> getRelatedOpinions() {
         return relatedOpinions;
Index: springapp/src/main/java/mk/profesori/springapp/Model/Section.java
===================================================================
--- springapp/src/main/java/mk/profesori/springapp/Model/Section.java	(revision 0e62f4dd2d93ff67c2c87c7e6f631bfc12bfb784)
+++ springapp/src/main/java/mk/profesori/springapp/Model/Section.java	(revision 7cb8c3c8e176ea1118e2a936b1b3c7a82323b6a9)
@@ -14,10 +14,11 @@
 import javax.persistence.OneToOne;
 
-import com.fasterxml.jackson.annotation.JsonBackReference;
-import com.fasterxml.jackson.annotation.JsonManagedReference;
+import com.fasterxml.jackson.annotation.JsonIdentityInfo;
+import com.fasterxml.jackson.annotation.ObjectIdGenerators;
 
 @Entity
+@JsonIdentityInfo(generator = ObjectIdGenerators.PropertyGenerator.class, property = "sectionId")
 public class Section {
-    
+
     @Id
     @GeneratedValue(strategy = GenerationType.IDENTITY)
@@ -35,5 +36,5 @@
     private StudyProgramme relatedStudyProgramme;
 
-    //getters and setters
+    // getters and setters
     public Long getSectionId() {
         return sectionId;
@@ -44,5 +45,4 @@
     }
 
-    @JsonManagedReference
     public List<_Thread> getThreads() {
         return threads;
@@ -53,5 +53,4 @@
     }
 
-    @JsonBackReference
     public StudyProgramme getRelatedStudyProgramme() {
         return relatedStudyProgramme;
@@ -67,4 +66,4 @@
         this.relatedStudyProgramme = relatedStudyProgramme;
     }
-    
+
 }
Index: springapp/src/main/java/mk/profesori/springapp/Model/StudyProgramme.java
===================================================================
--- springapp/src/main/java/mk/profesori/springapp/Model/StudyProgramme.java	(revision 0e62f4dd2d93ff67c2c87c7e6f631bfc12bfb784)
+++ springapp/src/main/java/mk/profesori/springapp/Model/StudyProgramme.java	(revision 7cb8c3c8e176ea1118e2a936b1b3c7a82323b6a9)
@@ -15,9 +15,10 @@
 import javax.persistence.Table;
 
-import com.fasterxml.jackson.annotation.JsonBackReference;
-import com.fasterxml.jackson.annotation.JsonManagedReference;
+import com.fasterxml.jackson.annotation.JsonIdentityInfo;
+import com.fasterxml.jackson.annotation.ObjectIdGenerators;
 
 @Entity
 @Table(name = "study_programme")
+@JsonIdentityInfo(generator = ObjectIdGenerators.PropertyGenerator.class, property = "studyProgrammeId")
 public class StudyProgramme {
 
@@ -43,5 +44,5 @@
     private Section relatedSection;
 
-    //getters
+    // getters
     public Long getStudyProgrammeId() {
         return studyProgrammeId;
@@ -56,15 +57,12 @@
     }
 
-    @JsonBackReference
     public Faculty getFaculty() {
         return faculty;
     }
 
-    @JsonManagedReference
     public Set<Subject> getSubjects() {
         return subjects;
     }
 
-    @JsonManagedReference
     public Section getRelatedSection() {
         return relatedSection;
Index: springapp/src/main/java/mk/profesori/springapp/Model/Subject.java
===================================================================
--- springapp/src/main/java/mk/profesori/springapp/Model/Subject.java	(revision 0e62f4dd2d93ff67c2c87c7e6f631bfc12bfb784)
+++ springapp/src/main/java/mk/profesori/springapp/Model/Subject.java	(revision 7cb8c3c8e176ea1118e2a936b1b3c7a82323b6a9)
@@ -2,8 +2,5 @@
 
 import java.util.ArrayList;
-import java.util.HashSet;
 import java.util.List;
-import java.util.Set;
-
 import javax.persistence.CascadeType;
 import javax.persistence.Column;
@@ -17,9 +14,10 @@
 import javax.persistence.Table;
 
-import com.fasterxml.jackson.annotation.JsonBackReference;
-import com.fasterxml.jackson.annotation.JsonManagedReference;
+import com.fasterxml.jackson.annotation.JsonIdentityInfo;
+import com.fasterxml.jackson.annotation.ObjectIdGenerators;
 
 @Entity
 @Table(name = "subject")
+@JsonIdentityInfo(generator = ObjectIdGenerators.PropertyGenerator.class, property = "subjectId")
 public class Subject {
 
@@ -39,5 +37,5 @@
     private List<_Thread> threads = new ArrayList<>();
 
-    //getters
+    // getters
     public Long getSubjectId() {
         return subjectId;
@@ -48,13 +46,11 @@
     }
 
-    @JsonBackReference
     public StudyProgramme getStudyProgramme() {
         return studyProgramme;
     }
 
-    @JsonManagedReference
     public List<_Thread> getThreads() {
         return threads;
     }
-    
+
 }
Index: springapp/src/main/java/mk/profesori/springapp/Model/University.java
===================================================================
--- springapp/src/main/java/mk/profesori/springapp/Model/University.java	(revision 0e62f4dd2d93ff67c2c87c7e6f631bfc12bfb784)
+++ springapp/src/main/java/mk/profesori/springapp/Model/University.java	(revision 7cb8c3c8e176ea1118e2a936b1b3c7a82323b6a9)
@@ -14,9 +14,10 @@
 import javax.persistence.Table;
 
-import com.fasterxml.jackson.annotation.JsonBackReference;
-import com.fasterxml.jackson.annotation.JsonManagedReference;
+import com.fasterxml.jackson.annotation.JsonIdentityInfo;
+import com.fasterxml.jackson.annotation.ObjectIdGenerators;
 
 @Entity
-@Table(name="university")
+@Table(name = "university")
+@JsonIdentityInfo(generator = ObjectIdGenerators.PropertyGenerator.class, property = "universityId")
 public class University {
 
@@ -36,5 +37,5 @@
     private Set<Faculty> faculties = new HashSet<>();
 
-    //getters
+    // getters
     public Long getUniversityId() {
         return universityId;
@@ -45,13 +46,11 @@
     }
 
-    @JsonBackReference
     public City getCity() {
         return city;
     }
 
-    @JsonManagedReference
     public Set<Faculty> getFaculties() {
         return faculties;
     }
-    
+
 }
Index: springapp/src/main/java/mk/profesori/springapp/Model/_Thread.java
===================================================================
--- springapp/src/main/java/mk/profesori/springapp/Model/_Thread.java	(revision 0e62f4dd2d93ff67c2c87c7e6f631bfc12bfb784)
+++ springapp/src/main/java/mk/profesori/springapp/Model/_Thread.java	(revision 7cb8c3c8e176ea1118e2a936b1b3c7a82323b6a9)
@@ -11,6 +11,4 @@
 import javax.persistence.JoinColumn;
 import javax.persistence.ManyToOne;
-
-import com.fasterxml.jackson.annotation.JsonBackReference;
 
 @Entity
@@ -39,18 +37,16 @@
     }
 
-    //getters
+    // getters
     public List<String> getTags() {
         return tags;
     }
 
-    @JsonBackReference
     public Section getParentSection() {
         return parentSection;
     }
 
-    @JsonBackReference
     public Subject getTargetSubject() {
         return targetSubject;
     }
-    
+
 }
Index: springapp/src/main/java/mk/profesori/springapp/Repository/UniversityRepository.java
===================================================================
--- springapp/src/main/java/mk/profesori/springapp/Repository/UniversityRepository.java	(revision 0e62f4dd2d93ff67c2c87c7e6f631bfc12bfb784)
+++ springapp/src/main/java/mk/profesori/springapp/Repository/UniversityRepository.java	(revision 7cb8c3c8e176ea1118e2a936b1b3c7a82323b6a9)
@@ -7,12 +7,13 @@
 
 import mk.profesori.springapp.Model.City;
-import mk.profesori.springapp.Model.Faculty;
 import mk.profesori.springapp.Model.University;
 
 @Repository
-public interface UniversityRepository extends CrudRepository<University, Long>{
+public interface UniversityRepository extends CrudRepository<University, Long> {
 
     public List<University> findAll();
+
     public University findByUniversityId(Long id);
+
     public List<University> findByCity(City city);
 }
Index: springapp/src/main/java/mk/profesori/springapp/Security/SecurityConfiguration.java
===================================================================
--- springapp/src/main/java/mk/profesori/springapp/Security/SecurityConfiguration.java	(revision 0e62f4dd2d93ff67c2c87c7e6f631bfc12bfb784)
+++ springapp/src/main/java/mk/profesori/springapp/Security/SecurityConfiguration.java	(revision 7cb8c3c8e176ea1118e2a936b1b3c7a82323b6a9)
@@ -1,5 +1,4 @@
 package mk.profesori.springapp.Security;
 
-import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.context.annotation.Bean;
 import org.springframework.context.annotation.Configuration;
@@ -28,19 +27,22 @@
 
     @Bean
-    public AuthenticationManager authenticationManager(AuthenticationConfiguration authenticationConfiguration) throws Exception {
+    public AuthenticationManager authenticationManager(AuthenticationConfiguration authenticationConfiguration)
+            throws Exception {
         return authenticationConfiguration.getAuthenticationManager();
     }
-    
+
     @Bean
     protected SecurityFilterChain filterChain(HttpSecurity http) throws Exception {
         http
-            .csrf().disable() //PRIVREMENO
-            .authorizeRequests()
+                .cors()
+                .and()
+                .csrf().disable() // PRIVREMENO
+                .authorizeRequests()
                 .antMatchers("/registration/**")
                 .permitAll()
-            .anyRequest()
-            .authenticated().and()
-            .formLogin();
-        
+                .anyRequest()
+                .permitAll().and() // bese .authenticated()
+                .formLogin();
+
         return http.build();
     }
