db config and api methods implemented