Cleaned up the code, and also made sure that on login there is proper error reporting.

More error reporting is needed on other areas if e.g. the Cassandra cluster is down, or others.
Appropriate HTTP error codes are necessary as well.