reorder ndb calls to make use of async