I've put return statements where necessary, so the extra conditions are not necessary. The `${QUERY_RESPONSE_} MATCHES "registry$"` condition is because the registry returns `/registry` rather than an empty string when no value for the key is found