Update API docs

and fix code style