Updated flask server example.
Added tests.
Fix for python3.