Plugin porting doesn't work - 6.4.4 => 7.0.0

Hi All,
the error shown above occur only the first time, when metric is properly configured but no bucket is define and I think it's quiet normal...

If i configure a single bucket, debugging the source code i found that the following line:

var buckets = resp.aggregations[statusAggId].buckets;

shows that no key called aggregations is defined for resp object:

maybe something is changed passing from 6.4.4 to 7.0.0... but I can't figure out where the buckets object is now located under resp object.

Please, any help will be appriciated.

Thanks.