Add database model and api