Over refactored. LoginResource needs not to retrieve username