I’ve made a python server script that can send serial commands to a connected usb serial device. I use this to control my retrotink 4k using a raspberrypi zero w, but it is generic enough that you could control other devices. In the readme, it shows how to setup a restful command.