Some refactoring of error displays for user login.
Merged conflict.
Got some base API role checking done and also added some error response and other stuff.