Created a function to create a JSON string -- makes many other functions simpler to read