db model and endpoints