db pieces: api, models, backend