fix build.url to work with API URLs that contains paths

Path component of the API URL is currently stripped from the request, so the URL doesn't work. This PR merges the paths properly so API URLs with paths work.