update middleware
update  example
update debug message and add controller subclass check
add json support