implemented middleware option
Merge pull request #70 from sergeyt/master

Implemented middleware option