added functionality for validating user by password and retrieving user by email