server side code for taking/returning a book