Added setApiMode method