Fixed multiple bugs server and client

-Server and client now properly handles the stream
-bug caused by improper handling of bytes causing incomplete msgs