WIP refactoring getUsername() and RESTService for login