adding json encodng for records