Quick and dirty implementation of csv download with limit and criteria