Library name gets checked to avoid duplicates

Library names is now being checked against the database to avoid
creating librarys that already exists. (#274)