adding apikey auth support and csv format