do some refactoring in httpserver to support added commands