Convert api mode to mode