From http://stackoverflow.com/questions/13907048/get-the-number-of-elements-in-a-json-object-using-jquery