Feature/en 1831

We should gracefully handle failure, especially for the login method. As written, this will throw a key not found exception if the login fails.