Add improved support for HTTP response codes in flask apps.

Change-Id: If9894b262c58c597d7f7ae0cf6cb5de6783d364d