Add export controller
Refactored ExportController logic to service
Added flat view for export queries