use proper JSON encoder

it is already a dependency anyway