Index: src/main/java/edu/gjoko/schedlr/config/AppAuthenticationFailureHandler.java
===================================================================
--- src/main/java/edu/gjoko/schedlr/config/AppAuthenticationFailureHandler.java	(revision 8bcd64c37eba4cd984953069331c9faa3a916671)
+++ src/main/java/edu/gjoko/schedlr/config/AppAuthenticationFailureHandler.java	(revision 8bcd64c37eba4cd984953069331c9faa3a916671)
@@ -0,0 +1,26 @@
+package edu.gjoko.schedlr.config;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.springframework.security.authentication.BadCredentialsException;
+import org.springframework.security.authentication.InternalAuthenticationServiceException;
+import org.springframework.security.core.AuthenticationException;
+import org.springframework.security.web.authentication.AuthenticationFailureHandler;
+
+import javax.servlet.ServletException;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import java.io.IOException;
+
+public class AppAuthenticationFailureHandler implements AuthenticationFailureHandler {
+
+    protected Log logger = LogFactory.getLog(this.getClass());
+    @Override
+    public void onAuthenticationFailure(HttpServletRequest request, HttpServletResponse response, AuthenticationException exception) throws IOException, ServletException {
+      if (exception instanceof InternalAuthenticationServiceException) {
+          response.sendRedirect(request.getContextPath() + "/login?error=notApproved");
+      } else if (exception instanceof BadCredentialsException) {
+          response.sendRedirect(request.getContextPath() + "/login?error=badCredentials");
+      }
+    }
+}
Index: src/main/java/edu/gjoko/schedlr/config/AppConfig.java
===================================================================
--- src/main/java/edu/gjoko/schedlr/config/AppConfig.java	(revision 905079022f7186a4860b626d48726296b486025f)
+++ src/main/java/edu/gjoko/schedlr/config/AppConfig.java	(revision 8bcd64c37eba4cd984953069331c9faa3a916671)
@@ -5,4 +5,5 @@
 import org.springframework.security.config.core.GrantedAuthorityDefaults;
 import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
+import org.springframework.security.web.authentication.AuthenticationFailureHandler;
 import org.springframework.security.web.authentication.AuthenticationSuccessHandler;
 
@@ -15,6 +16,11 @@
 
     @Bean
-    public AuthenticationSuccessHandler myApplicationAuthenticationSuccessHandler() {
+    public AuthenticationSuccessHandler appAuthenticationSuccessHandler() {
         return new AppAuthenticationSuccessHandler();
+    }
+
+    @Bean
+    public AuthenticationFailureHandler appAuthenticationFailureHandler() {
+        return new AppAuthenticationFailureHandler();
     }
 
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:
Index: src/main/java/edu/gjoko/schedlr/config/AppSecurityConfig.java
===================================================================
--- src/main/java/edu/gjoko/schedlr/config/AppSecurityConfig.java	(revision 905079022f7186a4860b626d48726296b486025f)
+++ src/main/java/edu/gjoko/schedlr/config/AppSecurityConfig.java	(revision 8bcd64c37eba4cd984953069331c9faa3a916671)
@@ -2,4 +2,5 @@
 
 import edu.gjoko.schedlr.services.PostgresUserDetailsService;
+import lombok.AllArgsConstructor;
 import org.springframework.context.annotation.Bean;
 import org.springframework.context.annotation.Configuration;
@@ -11,4 +12,6 @@
 import org.springframework.security.config.core.GrantedAuthorityDefaults;
 import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
+import org.springframework.security.web.access.AccessDeniedHandler;
+import org.springframework.security.web.authentication.AuthenticationFailureHandler;
 import org.springframework.security.web.authentication.AuthenticationSuccessHandler;
 import org.springframework.security.web.authentication.www.BasicAuthenticationFilter;
@@ -16,4 +19,5 @@
 @Configuration
 @EnableWebSecurity
+@AllArgsConstructor
 public class AppSecurityConfig extends WebSecurityConfigurerAdapter {
 
@@ -24,10 +28,5 @@
     private final AuthenticationSuccessHandler authenticationSuccessHandler;
 
-    public AppSecurityConfig(PostgresUserDetailsService userDetailsService, BCryptPasswordEncoder passwordEncoder,
-                             AuthenticationSuccessHandler authenticationSuccessHandler) {
-        this.userDetailsService = userDetailsService;
-        this.passwordEncoder = passwordEncoder;
-        this.authenticationSuccessHandler = authenticationSuccessHandler;
-    }
+    private final AuthenticationFailureHandler authenticationFailureHandler;
 
     @Bean
@@ -48,9 +47,10 @@
                 .authenticationEntryPoint(new AppAuthenticationEntryPoint())
                 .and()
-                .addFilterBefore(new AppFilter(), BasicAuthenticationFilter.class)
+                .addFilterAfter(new AppFilter(userDetailsService), BasicAuthenticationFilter.class)
                 .formLogin()
                 .loginPage("/login")
                 .loginProcessingUrl("/login")
                 .successHandler(authenticationSuccessHandler)
+                .failureHandler(authenticationFailureHandler)
                 .defaultSuccessUrl("/homepage")
                 .and()
Index: src/main/java/edu/gjoko/schedlr/config/MvcConfig.java
===================================================================
--- src/main/java/edu/gjoko/schedlr/config/MvcConfig.java	(revision 905079022f7186a4860b626d48726296b486025f)
+++ src/main/java/edu/gjoko/schedlr/config/MvcConfig.java	(revision 8bcd64c37eba4cd984953069331c9faa3a916671)
@@ -2,5 +2,4 @@
 
 import org.springframework.context.annotation.Configuration;
-import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
 import org.springframework.web.servlet.config.annotation.ViewControllerRegistry;
 import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
@@ -16,10 +15,5 @@
         registry.addViewController("/homepage").setViewName("homepage");
         registry.addViewController("/admin").setViewName("admin");
-    }
-
-    @Override
-    public void addResourceHandlers(ResourceHandlerRegistry registry) {
-        registry.addResourceHandler("/resources/**")
-                .addResourceLocations("/resources/");
+        registry.addViewController("/business_admin").setViewName("business_admin");
     }
 }
