Changed filter function to use jsonpath.