adding an utility method for handling json