You can write your own NVL function by checking for the existance of a field and returning 0 if it does not exist.
For the max functionality, you have to add a reduce function to your view. If you just want to get the maximum, "reduce": "_max"
will do, which is a built in reduce function.