Take care of "empty" records

Only add element to array if the json blob is populated.
Note that we still need to process lastId.