Allow using middleware for class controller routing by adding a constructor