moved cgi support to cli support, updated code
moved cgi support to cli support, updated code