Remade the command handler at the client. 

Changed small bits of server's code