updated snippets according to new api