abstracted away api routes into router