Improved final api url building.