Fixed bugs in start_daemon. Still need to fix multithreading, implement handle_request, and deal with memory leaks.