fixed bugs with lxml in api and bindings