Updated for recent changes to the API