added before middleware validation
fixed double names of method
add phpunit tests, fixed typo in method
add exceptions , change tests
added test for inValid after & before methods