Use urllib.parse to check if the URL has a path component. Only append /api when the path is empty (e.g. https://silo.kindred.internal). URLs that already include a path (e.g. http://localhost:8080/api) are left unchanged. Restore localhost placeholder as the default.