Changed library model to work on the new API.