Completed the login to the api server and added a logout route