Rewrite api registration