Fixing csv and html outputs

I clone this and CSV and HTML format doesn't work until y make this changes
I use API KEY auth