using lrutils to handle errors and after_request headers