Move defer to APIBase._defer