Adding range-based qualifiers to the array_to_json function