Added logout functionality to the API