Move login-related logic to client-side. EVERYTHING shold be done via API calls!