Fix issue where REST API path was being encoded (therefore replacing
spaces in URL) prematurely.