create functions for generating JSON #2