Improved parsing of the data from sendgrid.