adjusted exception for api libraries (changed together with @bruderol)