Fix issue with format detection
Add csv header to response