added shutdown service and implemented basic shutdown (application now stops without leaving open threads running)

fixed a lot of small bugs application runs now with two clients