add csv output option to api