Changed path_regex and added case for undefined response