If the exception json is not a json, return the array with message set
to the original string.
Updated the Client error result:
If Rate Exceeded error, set special T001 with RESEND status
Else set normal and ifn othing set to E999 with FAILURE
Because status RESEND/FAILURE has to be checked we also add this to the
Exception return json string.
Also handle unset errors (eg when we get an Rate Limit error)
Move the _ENV check into mtheod
test now has some basic mock tests