use JSON::XS instead of JSON

Some places used JSON::XS other places used JSON. Let's use only one of them.