update api doc, remove unused imports, clean things up a bit