library service with conditional get