Fix for response code 204 (instead of 200)

Plus correction of one (of multiple) wrong exception
message generation.
Fix HTTP code checking for auth and bad format string in exceptions

Add test to validate exception handling.