Client was not properly disconnecting
Restructured server code
so that the recv() and parsing is done in the handler(),
which then delegates the other tasks to other functions.