add api docs, fix stuffs