I do not understand. Suppose I want to export the aggregate losses and by mistake I pass export_type='xml'. Then there should be an error, here a KeyError since there is no function export_aggregate_losses_xml but only  export_aggregate_losses_csv. Where is the problem? You could even trap the error and print a warning "could not export aggregate_losses in xml format" if you wanted. I guess I am missing a piece of the picture.