updated examples for new API