ticket:3 tests
ticket:3 middleware and stuff