create functions for generating JSON 3.2.2014