added json functionality