remove error hook from Application, added tests for after/before hooks