add a debug level option and fail harder when a template cant be resolved or an invalid filter is applied