n21 middleware