Fix Google app engine API related issues

Fix issue #136
Fix issue #137