GO port of cm_api