Do not use deprecated getEndpoint() method