improved error handling to return correct the WebExceptionStatus code based on the NSError returned by the system