before and after request