App Engine hook. Untested.