Generally we don’t recommend this type of architecture for performance reasons, as well as the general difficulty of integrating / maintaining it.
However, in cases where people have attempted this, you probably need to create your own API layer for any NetSuite APIs or services you want to call, using Suitelets. You can call the search API, for example, ‘internally’ by having the SuiteScript in the Suitelet handle the request/response, and then send it back to the user who called the Suitelet.
I really must stress, however, that this is not something we recommend.