ticket:3 add middleware realization