Refactoring the products controller to respond to JSON - created a Basic API