some modif to output JSON rather than RAW HTML
add some logic for HTTP get command