api routes helper