Authenticate using server.
Error handling. Covering edge cases. Cleanup.