add fetching of email to javascript api