Refactor querystring conversion to object.
Apply stricter checking to database query responses.