Added structural tests for JSON encoding