Added Flask flash() and fixes for server