Outputting results to JSON