Correct handling of errors in context managers. APICache can now be flaged on