604 add xls export to data endpoint

closes #604
I am refactoring this to a separate function as suggested