'Father method for _api_item and _api_value'

def _api_itemvalue(self, plugin, item, value=None, history=False, nb=0):

    response.content_type = 'application/json'
    if (plugin not in self.plugins_list):
        abort(400, ('Unknown    plugin    %s    (available    plugins:    %s)' % (plugin, self.plugins_list)))
    self.__update__()
    if (value is None):
        if history:
            ret = self.stats.get_plugin(plugin).get_stats_history(item, nb=int(nb))
        else:
            ret = self.stats.get_plugin(plugin).get_stats_item(item)
        if (ret is None):
            abort(404, ('Cannot    get    item    %s%s    in    plugin    %s' % (item, ('history    ' if history else ''), plugin)))
    else:
        if history:
            ret = None
        else:
            ret = self.stats.get_plugin(plugin).get_stats_value(item, value)
        if (ret is None):
            abort(404, ('Cannot    get    item    %s(%s=%s)    in    plugin    %s' % (('history    ' if history else ''), item, value, plugin)))
    return ret
