add result constructing to default middlewares, create 'use' method for registering new middlewares