R API Serialization