removed get_cls, adapted binary json, added some error check