Add tests to JSON protocol