adding stubs for tests and a middleware class for stripping trailing /s