fixed overall routes and db constraints