resp.responseText is a json that can (a) contain multiple messages and (b) contains key-value pairs, where the key is the message type, and the value is the message text.

So you can get the message type (warning, etc) from the `messages` variable, which should contain everything we need.