Replace service implementation from threads to event loop

Now the service uses event machine instead of threads
remove unused code