Rewrite examples for new api