adding hooks for before and after req