support old and new versions of APIError