first pass at adapting to GAE (not working yet)