Fixed empty check for resource and id in url