fixed response code; implemented basic connection