Update index.js

Parse the JSON result as a simple test of validity