refactor the controller to check for files before returning 202

Adds support for returning files if they exist even if the data are generating another dataset. Before this all requests were blocked until the file creation was done (even if it the data requested were ready for download)