Updated code to reflect item API improvements