db middlware; orm layer; api routes now mounted under /api; general cleanup