refactored duplicate code in v2routes
simpler register email
fixed call to undefined function