corrected json serialization and tests