Unless something has changed, ES is just a pretty wrapper around es_systems.cfg which tells you where the roms are, and what command to run to launch the emulator. RetroPie did a bunch of work to help customize the launching but seems like you could write an HTTP server that could receive a request then stop ES, run the launch command, then restart ES afterward all based on the data in es_systems.