returning stats as json instead of csv