apply cb(err, res) convention for middlewares