Updated most of the examples with the new API.