update StatusCode

StatusCode are completely different from those used earlier. they are now hopefully correct.
small updates
done. I also pushed by mistakes som cleanup code and small additions, but they should be ok.