rewrite API