Re #940 - Centralize URL generation for both Portal and API