rest api to write to db and send emails upon user registration