API improvements & bug fixes