setup db connection with some read and write apis