Reorganise api function order.