Added persist for resources
Updated samples
Added helper functions for socket/groups and fixes issue