Added function to get formatted json