factory APIException.fromJson(Map<String, dynamic> json) { return APIException( name: json['error']['name'].toString(), message: json['error']['message'], ); }