Outputting JSON data with the counts as well.