1) finish cgi original implementation; 2) fix bugs.