add exception handler for appmanager; add tests for apps.py
some test case