Don't issue a warning if an API response has no "error_code"

In certain unusual situations, the API may produce a JSON response that has no
"error_code" key. In this case, the client currently tries to access it and
issues a warning ("PHP Notice:  Undefined property ...") depending on
configuration.

Instead, test that "error_code" exists before accessing it.