Completing the python wrapper + editing the c APIs