stuff to convert data into json