add base middleware and session