Before and after request handlers

For #5