Parse XML response and implement error code checks
Small fixes to get email sending working