Updated samples for latest API changes