Updated to reflect changes in the API