refactored api, finished login, and sign out