Adding function to convert from dictionary to JSON string.