Upgrade model to use ndb api.