Get the endpoint from the current URL, if not specified

This isn't ideal, but works for now.