code snippet added for json