Adding code to get the original URI in the endpoint