task 2 -> db api
code written during lecture 2