modify public/api rewriting