Add error handling from JSON in response
Add support for login with username and password