Adding C api calls for malloc and free