tinkering with middleware in tornado