prints json object to file