fixed two redirect bugs, added additional testing code in tests/test_app.py to run : use python -m tests.test_app