updated HTTP status  handling code
Merge origin/master