Refactored handler methods to allow for proper error returns. Added error handling for invalid username scenario.