generate json for product and category