How out of block chain transactions work, and is there any API for that?
Off-chain transactions are transactions on any system that's not the blockchain. Micropayment transactions, lightning network transactions and even coinbase-to-coinbase or changetip would count as off-chain transactions.

There are API's to the various services. Lightning network is not live yet and micropayment transactions still need settlement on the blockchain.