bug fix : did not look for cgi-config.json at correct location
better type guessing