Changes monkey_patch for mxin
Reorganizes API hooks