output to file as jsons