Fixing examples to use the new API