Updated samples to latest API changes