handler takes pid
thumb server and generator impl.
Do not hardcode loopback ip
move stuff around and refactor a bit