Adds error handling to filter.
Improved logging functions.
Improves error handling.
Allows modules to optionally receive `response` as an argument.