postMessage-based protocol and API builder