email service endpoints and tests