Added Login error message, user role verifycation, minor refactoring