added login and logout function and token storage