Updated to use a map: name->query for the full list of endpoints rather than a list of name-value pairs.