Add a JSON API for querying nodes.