Fixed nullpointer error in deleteResource api