Help: Want a solution for createing and setting up outbound route via API/CLI or remote

For this application, I would not use the regular inbound and outbound routes at all. Set up a database with virtual numbers and extensions. For incoming, use a Custom Destination to look up the DID and route to the correct extension. Possibly, Sangoma Documentation will do what you need and you won’t have to write any dialplan code.

For outgoing, I’d use a dialout hook to rewrite the caller ID: