change control method from websockets to REST and use npx module