Switched to the ndb framework to take advantage of the automatic caching of datastore reads.