further binding, fixes of logic and language errors in py api