ticket:3
middleware written, test pass