removed public_path basedir dependencty, begin to switch some controller functions to retun json