As for how your app "connects" to the API to talk to the OS, no you don't have to establish a "connection" through a port or anything like that. Generally the API functions are manifest in a shared library. You would need to look up in your programming language documentation how to do a shared library call. It might even be called an API call. This command will trigger the shared function within the library from your code.
An example: Let's say you want to write a GUI app for the Amiga. You could write it all from scratch, telling the hardware directly to draw some pixels in a particular place. But that would take ages, so you make the API do it for you. So you make a call to (probably) Intuition, basically saying "draw a window on this screen, in this position, this wide and this high", and Intuition then takes care of the rest for you.
--
moto