add csv export to createReadStream and the REST API