Added a new method to retrieve cart contents as a json object