Model daemon as its own http handler to simplify the logic