Restructured routes and finished the login and logout logic