Updated examples to latest api changes and some extra improvement