added c deserialization of complex types and refactored interface