fix some bugs and add API dll