updated example to include socket api layer