add daemon feature: let server run as a daemon