fix bug & change api algorithm for api token