adds API interaction for library page.