You don't sprinkle URLs throughout your codebase, as the OP apparently assumes one would normally do. You create a single class (or something similar) which abstracts the API calls. If the endpoint changes, you change it in one place.
I honestly don't see how this solution makes this easier. If anything, I feel like it makes things more complicated and harder to understand.