store occurrence counts into json format