hook up debug mode
fix reporting keys
clean up middleware