add library api
Merge pull request #4 from Trott/library

add library api