Added quit, send and receive methods in JS