adding json creation functionality