Added Middleware support
Changed var def to match capitalized version in docs