Add loading screen and fix promises to go back to login page on failure