Returns a JSON representation of ApiErrorResponse.
Map<String, dynamic> toJson() { return {'requestId': requestId, 'error': error}; }