Does Electrum provides any API?
Yes for sure, You can send requests to electrum servers or your server (recommended) by sending JSON-RPC requests. 

Take a look on Electrum documentation 

https://electrumx.readthedocs.io/en/latest/protocol-methods.html

for bitcoin cash use Electroncash  same commands work.

For example, to broadcast a hex transaction you can call

{"id": 1, "method": "blockchain.transaction.broadcast", "params": ["YOUR_HEX_TRANSACTION"]}

There are no wallet commands available, but blockchain commands.