refactoring the products controller to responsd to JSON