CH-1164 Added drush command to get segments

Also, added response code check to getSegments and more complete error handling/error reporting