Added function for getting the email via the rest api