Use HTTP::Daemon for http request handling