Updated code so that it passes analyzer following dart:json changes
Updated text to use new dart:convert API