updated README snippet to use new api