fix protocol issue in api script