ticket:3 rename middleware->middlewares
ticket:3 tests refactoring

Modified test cases to cover more cases + to be more readable