functionalize of data struct to json