API wrapper for OnConnect