json functionality and enum