error handling when extracting grid ID from url, support for env DEBUG (prints url + resulting grid object id