takes routes from the database