Add guard clause to getEndpoint to prevent throwing away options.endpoint if passed in on a nested resource.