Middleware compose fix

This adds a condition to the array wrapper when composing the middleware.
Without this adding middleware on creation ( Resource('users', preRequestMiddleware, actions) ) and per route failed.