clean and ready for write c code
implement the API for c code but no tested