Starting to rewrite the api routes