public function parseResponse($deleteTokenOnFail = false)
    {
        $responseArray = json_decode($this->response, true);
        if (isset($responseArray['error']) && $responseArray['error']) {
            // token should be unset assumed to be no longer valid
            unset($this->token);
            // delete token from data store if param is passed
            if ($deleteTokenOnFail) {
                $this->deleteToken();
            }
            return $this->response; 
        }
        $this->token = $responseArray['securityToken'];
        return 'success';
    }