fix weird exception handling

also cleaned up server class
- removed Runnable implementation
- removed stupid while loop