Refactored password reset to the api