fix APIs, add python API

Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>