update StatusCode

StatusCode are completely different from those used earlier. they are now hopefully correct.
small updates
Let put this in the status_codes? Or may be another place with corresponding name.
This is useful function can be used everywhere.