build_url extracts query parameters from path