Fix client code to use new api