Updated to latest API changes