JavaScript Socket \API with server