add internal middleware chain support
add error handler logic
refactor inner middleware chain. add app embeded as middleware