Index: src/main/java/edu/gjoko/schedlr/config/AppFilter.java
===================================================================
--- src/main/java/edu/gjoko/schedlr/config/AppFilter.java	(revision 905079022f7186a4860b626d48726296b486025f)
+++ src/main/java/edu/gjoko/schedlr/config/AppFilter.java	(revision 8bcd64c37eba4cd984953069331c9faa3a916671)
@@ -1,8 +1,11 @@
 package edu.gjoko.schedlr.config;
 
+import edu.gjoko.schedlr.services.PostgresUserDetailsService;
+import lombok.RequiredArgsConstructor;
 import org.springframework.security.core.GrantedAuthority;
 import org.springframework.security.core.context.SecurityContextImpl;
 import org.springframework.security.core.userdetails.UserDetails;
 import org.springframework.util.StringUtils;
+import org.springframework.web.bind.annotation.RequestBody;
 import org.springframework.web.filter.GenericFilterBean;
 
@@ -12,4 +15,5 @@
 import javax.servlet.ServletResponse;
 import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
 import javax.servlet.http.HttpSession;
 import java.io.IOException;
@@ -18,24 +22,40 @@
 import java.util.Map;
 
+@RequiredArgsConstructor
 public class AppFilter extends GenericFilterBean {
+
+    private final PostgresUserDetailsService userDetailsService;
     @Override
     public void doFilter(ServletRequest servletRequest, ServletResponse servletResponse, FilterChain filterChain) throws IOException, ServletException {
         HttpServletRequest httpServletRequest = (HttpServletRequest) servletRequest;
         HttpSession session = httpServletRequest.getSession(false);
+        HttpServletResponse response = (HttpServletResponse) servletResponse;
 
         if(httpServletRequest.getRequestURI().endsWith(".js")
-                || httpServletRequest.getRequestURI().endsWith(".css")
-                || httpServletRequest.getRequestURI().startsWith("/api")) {
+                || httpServletRequest.getRequestURI().endsWith(".css")) {
             filterChain.doFilter(servletRequest, servletResponse);
             return;
         }
+
+        if(httpServletRequest.getRequestURI().startsWith("/api")) {
+            session = ((HttpServletRequest) servletRequest).getSession(true);
+            SecurityContextImpl sci = (SecurityContextImpl) session.getAttribute("SPRING_SECURITY_CONTEXT");
+
+            if(sci != null && session.getAttribute("stakeholderId") == null) {
+                UserDetails userDetails = (UserDetails) sci.getAuthentication().getPrincipal();
+                Long stakeholderId = userDetailsService.loadStakeholderId(userDetails.getUsername());
+                session.setAttribute("stakeholderId", stakeholderId);
+            }
+            filterChain.doFilter(servletRequest, servletResponse);
+            return;
+        }
+
         if(session != null) {
-            Map<String, String> roleTargetUrlMap = new HashMap<>();
-            roleTargetUrlMap.put("ADMIN", "/admin");
-            roleTargetUrlMap.put("CUSTOMER", "/homepage");
-            roleTargetUrlMap.put("BUSINESS_OWNER", "/business_homepage");
             SecurityContextImpl sci = (SecurityContextImpl) session.getAttribute("SPRING_SECURITY_CONTEXT");
             if(sci != null) {
                 UserDetails userDetails = (UserDetails) sci.getAuthentication().getPrincipal();
+                Long stakeholderId = userDetailsService.loadStakeholderId(userDetails.getUsername());
+                session.setAttribute("stakeholderId", stakeholderId);
+
                 final Collection<? extends GrantedAuthority> authorities = userDetails.getAuthorities();
                 for (final GrantedAuthority grantedAuthority : authorities) {
@@ -47,6 +67,8 @@
                             break;
                         case "CUSTOMER":
+                            page = "/homepage";
+                            break;
                         case "BUSINESS_OWNER":
-                            page = "/homepage";
+                            page = "/business_admin";
                             break;
                         default:
