generating json for download