Refactor Shipments API & JS.