fix profiles selection query
serve individual profiles as csv as well
convert timestamp into string for json output