There is an error in the code of this file

I've corrected an error that saw the file output a 1 after printing the results, I've also bought the file more inline with the other example by showing how to decode the json into an array.