1:refector code;add api.h, viewController.h