Updates cart to group items with quantity>1
Handles invalid cart error and cart_id injections
Cleans up cart