start of db work for api