You don't have to create an API over Ranorex. The Ranorex itself is the automation container which will run it for you. Basically what you do is automate the user actions (which for you would be swipe action in the emulators Viber app for example). You can take a quick look at this page which explains quite well what Ranorex (and basically any other UI automation tool) actually is and what it's capable of ranorex.com/support/user-guide-20.html
But basically yes the functionality for eg. listening to the incoming messages and acting upon it is in the automation tools logic. I'm not sure what you mean about the API for exposing the information about a court. Ranorex (and other UI auotmation tools) can handle the changes in the applications and get the data from the applications themselves. So it's more like installing an emulator for Android, downloading the Viber app and then automating the user action in the auotmation tool.