Outputs JSON to a file