contains function to code/decode JSON