fix main function bugs;
AccessKey API : DONE