updated both with json functionality