Improve error handling around token API.
Allow underscores in email addresses.