Add logout functionality in the api.