Modified the API so that any extraneous path info is stripped before saving relatedResource data.

Also fixed the URL parameter for API patching so that it won't continue to add locations that are already present