function rest_sendSuccessResponse($sts = 200, $stsmsg = "OK", $body = null)
{
    rest_CacheHeaders();
    header("HTTP/1.1 {$sts} - {$stsmsg}", true, $sts);
    if ($body != null) {
        trace("sending " . $body, __FILE__, __LINE__, __METHOD__);
        echo $body;
    }
}
function json_sendObject($jsonObject)
{
    rest_CacheHeaders();
    header("Content-Type: application/json");
    $string = json_encode($jsonObject);
    if ($string === false) {
        return false;
    }
    trace("json_sendObject sends " . $string, __FILE__, __LINE__, __METHOD__);
    echo $string;
    return true;
}