Refactoring the products to respond to json