extended APIError class with getErrorResponse and rewrote getErrorText