Add debug mode param
Migrate http server to appmodel too