added json stub methos and started implementing encode and decode