added connection calls and curl and js samples for them