cleaning up api and making the routes url a configuration option