add db to api for lazy loading