Serialize clazz as class in all API classes