add args to json_encode method