api doc + code cleaning