Implemented json-encoder for a scarph schema