def METHOD_NAME(counselors, zipcodes, target):
    connection = get_db_connection()
    fill_db(connection, counselors)
    logger.info("generating JSON into %s", target)
    for zipcode, (latitude_degrees, longitude_degrees) in zipcodes.items():
        counselors = query_db(
            connection, radians(latitude_degrees), radians(longitude_degrees)
        )
        zipcode_data = {
            "zip": {
                "zipcode": zipcode,
                "lat": latitude_degrees,
                "lng": longitude_degrees,
            },
            "counseling_agencies": counselors,
        }
        json_filename = os.path.join(target, "{}.json".format(zipcode))
        with open(json_filename, "w") as f:
            f.write(json.dumps(zipcode_data))