Properly format the json output.