Changed express middleware to use keyword argument and added prefix arg

I've decided to change the middleware to user keyword arguments
because the positional argument don't seem to be mutually exclusive.
I may want to specify the userId without specifying the `numPathComponents`.

Additionally, I've added a prefix argument that strips the req.url of
the specified prefix. This can be useful, if the REST url has something
like a version in the path.