added GetEndpointURL function