#488 Fixed some bugs and updated examples for api docs