rewrite API, refine commits, add new test and get umask from system