Updated api to successfully authenticate and deauthenticate users.