Moved middleware so it doesn't fail without the slash [MJ-389]

All tests pass.