Add api callbacks.