fixes routes and cleans database