Fix logout process to go back to login page
Take out useless logic from index route
Reject promises on error
Add default error handler that redirects to login on load error