made server dynamically handle requests

this involves multi threading.