I have a web app that has lots of pages with a URL of the form /object_type/object_id/ which show this objects details. I also have a RESTful API, returning a JSON/XML representation of my objects (under /api/object_type/object_id/ ). (My objects are Laws and Bills, but I guess this question is rather generic).
From time to time, I discover that 2 or more of my objects are actually duplicates, and describe the same object in the real world. Lets say they were /Bill/111/ and /Bill/222/ . Behind the scenes I merge the 2 objects, leaving 1 object (lets say /Bill/111/ ) with all the information, and the other "empty" with just a reference to the other one.
My question is, how should I indicate the merge in the web app and in the API? I don't want /Bill/222/ to return a 404, because I might have external links pointing to it, and I don't want them broken. Should I use a 301 Moved Permanently? Should I return a normal page (with status 200) explaining that this resource was detected as duplicate with a link to the merged one? How should I deal with this in the API? for example, should I list 222 in the Bills index?