added updated endpoint client code