monitor/REST_handle.js
function (res, res_obj) {

    // return response if exist, otherwise response might be returned 
    // AFTER some callback is done handling (i.e., response will be returned within the handler)
    if (typeof res_obj === 'string') {
        LOG.sys('replying a string: ' + res_obj);
        res.writeHead(200, {'Content-Type': 'text/plain'});                     
        res.end(res_obj);            
    }
    else {
        LOG.sys('replying a JSON: ' + JSON.stringify(res_obj));
        res.writeHead(200, {'Content-Type': 'application/json'});                     
        res.end(JSON.stringify(res_obj));        
    }
}
function (res, res_obj) {

    // return response if exist, otherwise response might be returned 
    // AFTER some callback is done handling (i.e., response will be returned within the handler)
    if (typeof res_obj === 'string') {
        LOG.sys('replying a string: ' + res_obj);
        res.writeHead(200, {'Content-Type': 'text/plain'});                     
        res.end(res_obj);            
    }
    else {
        LOG.sys('replying a JSON: ' + JSON.stringify(res_obj));
        res.writeHead(200, {'Content-Type': 'application/json'});                     
        res.end(JSON.stringify(res_obj));        
    }
}
function ( res , res_obj ) { // return response if exist, otherwise response might be returned  // AFTER some callback is done handling (i.e., response will be returned within the handler) if ( typeof res_obj === 'string' ) { LOG . sys ( 'replying a string: ' + res_obj ) ; res . writeHead ( 200 , { 'Content-Type' : 'text/plain' } ) ; res . end ( res_obj ) ; } else { LOG . sys ( 'replying a JSON: ' + JSON . stringify ( res_obj ) ) ; res . writeHead ( 200 , { 'Content-Type' : 'application/json' } ) ; res . end ( JSON . stringify ( res_obj ) ) ; } }
helper code  send back response to client
helper code send back response to client