cal to json function