diff --git tests/functional/ServicesResourceNodeTests.test tests/functional/ServicesResourceNodeTests.test
index fd381a5..cb5b740 100644
--- tests/functional/ServicesResourceNodeTests.test
+++ tests/functional/ServicesResourceNodeTests.test
@@ -11,8 +11,10 @@ require_once('ServicesWebTestCase.php') ;
  *
  */
  class ServicesResourceNodeTests extends ServicesWebTestCase {
- // Class variables
+  // Class variables
   protected $privilegedUser = NULL ;
+  // Endpoint details.
+  protected $endpoint = NULL;
 
    /**
     * Implementation of setUp().
@@ -26,6 +28,8 @@ require_once('ServicesWebTestCase.php') ;
       'services_sessauth',
       'inputstream'
      );
+     // Set up endpoint.
+     $this->endpoint =  $this->saveNewEndpoint();
    }
 
    /**
@@ -48,15 +52,11 @@ require_once('ServicesWebTestCase.php') ;
        'administer services',
     ));
     $this->drupalLogin($this->privilegedUser);
-    $endpoint =  $this->saveNewEndpoint();
+
     $node = $this->drupalCreateNode();
-    $responseArray = $this->servicesGet($endpoint->path.'/node');
+    $responseArray = $this->servicesGet($this->endpoint->path . '/node');
     $nodeResourceIndex = json_decode($responseArray['body']);
-    if($node->title == $nodeResourceIndex[0]->title) {
-      $this->pass('Successfully received Node info', 'NodeResource: Index');
-    } else {
-      $this->fail(t('Something went wrong. StatusCode: !status', array('!status' => $responseArray['status'])), 'NodeResource: Index');
-    }
+    $this->assertTrue($node->title == $nodeResourceIndex[0]->title, t('Successfully received Node info'), 'NodeResource: Index');
    }
   /**
     * testing node_resource Get
@@ -67,23 +67,13 @@ require_once('ServicesWebTestCase.php') ;
          'administer services',
      ));
      $this->drupalLogin($this->privilegedUser);
-    $endpoint =  $this->saveNewEndpoint();
-    $node = $this->drupalCreateNode();
-    $responseArray = $this->servicesGet($endpoint->path.'/node/'. $node->nid);
+    $responseArray = $this->servicesGet($this->endpoint->path . '/node/' . $node->nid);
     $nodeResourceGet = json_decode($responseArray['body']);
-    if($node->title == $nodeResourceGet->title) {
-      $this->pass('Successfully received Node info', 'NodeResource: Retrieve');
-    } else {
-      $this->fail(t('Something went wrong. StatusCode: !status', array('!status' => $responseArray['status'])), 'NodeResource: Retrieve');
-    }
+    $this->assertTrue($node->title == $nodeResourceGet->title, t('Successfully received Node info'), 'NodeResource: Retrieve');
     //Verify node not Found
     unset($node);
-    $responseArray = $this->servicesGet($endpoint->path.'/node/99');
-    if($responseArray['code'] == '404') {
-      $this->pass('Successfully was rejected to non existent node', 'NodeResource: Retrieve');
-    } else {
-      $this->pass('I didnt get rejected, bad news!', 'NodeResource: Retrieve');
-    }
+    $responseArray = $this->servicesGet($this->endpoint->path . '/node/99');
+    $this->assertTrue($responseArray['code'] == '404', t('Successfully was rejected to non existent node'), 'NodeResource: Retrieve');
    }
   /**
     * testing node_resource Create
@@ -95,33 +85,22 @@ require_once('ServicesWebTestCase.php') ;
        'administer nodes',
     ));
     $this->drupalLogin($this->privilegedUser);
-    $endpoint =  $this->saveNewEndpoint();
     $node = array(
       'node[title]' => 'testing',
       'node[body]' => 'bodytest',
       'node[type]' => 'story',
       'node[name]' => $this->privilegedUser->name,
     );
-    
+
     $data = $this->services_build_postfields($node);
-    $responseArray = $this->servicesPost($endpoint->path.'/node', $data, array('Accept: application/json'));
+    $responseArray = $this->servicesPost($this->endpoint->path . '/node', $data, array('Accept: application/json'));
     $nodeResourceCreateReturn = json_decode($responseArray['body']);
-    
-    if(isset($nodeResourceCreateReturn->nid)) {
-      $this->pass('Node was successfully created',  'NodeResource: Create');
+
+    $this->assertTrue(isset($nodeResourceCreateReturn->nid), t('Node was successfully created'), 'NodeResource: Create');
+    if (isset($nodeResourceCreateReturn->nid)) {
       $newNode = node_load($nodeResourceCreateReturn->nid);
-      if($newNode->title = $node['node[title]']) {
-        $this->pass('Title was the same',  'NodeResource: Create');
-      } else {
-        $this->fail('Title was different', 'NodeResource: Create');
-      }
-      if($newNode->body = $node['node[body]']) {
-        $this->pass('Body was the same', 'NodeResource: Create');
-      } else {
-        $this->fail('Body was different', 'NodeResource: Create');
-      }
-    } else {
-      $this->fail(t('Creating the node failed. StatusCode: !status', array('!status' => $responseArray['status'])), 'NodeResource: Create');
+      $this->assertTrue($newNode->title = $node['node[title]'], t('Title was the same'), 'NodeResource: Create');
+      $this->assertTrue($newNode->body = $node['node[body]'], t('Body was the same'), 'NodeResource: Create');
     }
   }
   /**
@@ -133,23 +112,18 @@ require_once('ServicesWebTestCase.php') ;
        'administer services',
     ));
     $this->drupalLogin($this->privilegedUser);
-    $endpoint =  $this->saveNewEndpoint();
     $node = array(
       'node[title]' => 'testing',
       'node[body]' => 'bodytest',
       'node[type]' => 'story',
       'node[name]' => $this->privilegedUser->name,
     );
-    
+
     $data = $this->services_build_postfields($node);
-    $responseArray = $this->servicesPost($endpoint->path.'/node', $data, array('Accept: application/json'));
+    $responseArray = $this->servicesPost($this->endpoint->path . '/node', $data, array('Accept: application/json'));
     $nodeResourceCreateReturn = json_decode($responseArray['body']);
-    
-    if($responseArray['code'] = 401) {
-      $this->pass('User with permissions cannot create node',  'NodeResource: Create');
-    } else {
-      $this->fail(t('User was able to create nodes without permission. StatusCode: !status', array('!status' => $responseArray['status'])), 'NodeResource: Create');
-    }
+
+    $this->assertTrue($responseArray['code'] = 401, t('User with not sufficient permissions cannot create node'), 'NodeResource: Create');
   }
   /**
     * testing node_resource Validate missing Title
@@ -161,7 +135,6 @@ require_once('ServicesWebTestCase.php') ;
        'administer nodes',
     ));
     $this->drupalLogin($this->privilegedUser);
-    $endpoint =  $this->saveNewEndpoint();
     $node = $this->drupalCreateNode();
     $node_update = array(
       'node[title]' => '',
@@ -169,14 +142,12 @@ require_once('ServicesWebTestCase.php') ;
       'node[name]' => $this->privilegedUser->name,
       'node[type]' => 'story',
     );
-    
+
     $data = $this->services_build_postfields($node_update);
-    $responseArray = $this->servicesPost($endpoint->path.'/node', $data, array('Accept: application/json'));
+    $responseArray = $this->servicesPost($this->endpoint->path . '/node', $data, array('Accept: application/json'));
     $nodeResourceUpdateReturn = json_decode($responseArray['body']);
     $nodeAfterUpdate = node_load($nodeResourceUpdateReturn);
-    if(strpos($responseArray['status'], 'Title field is required.')) {
-      $this->pass('Node was not created, no title. ', 'NodeResource: Created');
-    }
+    $this->assertTrue(strpos($responseArray['status'], 'Title field is required.'), t('Node was not created without title. '), 'NodeResource: Created');
   }
   /**
     * testing node_resource Update
@@ -188,7 +159,6 @@ require_once('ServicesWebTestCase.php') ;
        'administer nodes',
     ));
     $this->drupalLogin($this->privilegedUser);
-    $endpoint =  $this->saveNewEndpoint();
     $node = $this->drupalCreateNode();
     $node_update = array(
       'node[title]' => 'testing',
@@ -196,25 +166,15 @@ require_once('ServicesWebTestCase.php') ;
       'node[type]' => 'story',
       'node[name]' => $this->privilegedUser->name,
     );
-    
+
     $data = $this->services_build_postfields($node_update);
-    $responseArray = $this->servicesPut($endpoint->path.'/node/'.$node->nid, $data, array('Accept: application/json'));
+    $responseArray = $this->servicesPut($this->endpoint->path . '/node/' . $node->nid, $data, array('Accept: application/json'));
     $nodeResourceUpdateReturn = json_decode($responseArray['body']);
     $nodeAfterUpdate = node_load($nodeResourceUpdateReturn);
-    if(isset($nodeAfterUpdate->nid)) {
-      $this->pass('Node was successfully updated',  'NodeResource: Updated');
-      if($nodeAfterUpdate->title = $node_update['node[title]']) {
-        $this->pass('Title was the same',  'NodeResource: Update');
-      } else {
-        $this->fail('Title was different', 'NodeResource: Update');
-      }
-      if($nodeAfterUpdate->body = $node_update['node[body]']) {
-        $this->pass('Body was the same', 'NodeResource: Update');
-      } else {
-        $this->fail('Body was different', 'NodeResource: Update');
-      }
-    } else {
-      $this->fail(t('Updating the node failed. StatusCode: !status', array('!status' => $responseArray['status'])), 'NodeResource: Update');
+    $this->assertTrue(isset($nodeAfterUpdate->nid), t('Node was successfully updated'), 'NodeResource: Updated');
+    if (isset($nodeAfterUpdate->nid)) {
+      $this->assertTrue($nodeAfterUpdate->title == $node_update['node[title]'], t('Title was the same'), 'NodeResource: Update');
+      $this->assertTrue($nodeAfterUpdate->body == $node_update['node[body]'], t('Body was the same'), 'NodeResource: Update');
     }
   }
   /**
@@ -228,23 +188,21 @@ require_once('ServicesWebTestCase.php') ;
        'edit own story content',
     ));
     $this->drupalLogin($this->privilegedUser);
-    $endpoint =  $this->saveNewEndpoint();
+
+    // Create node from user no 1.
     $node = $this->drupalCreateNode(array('uid' => 1));
+
+    // Try to update this node with different user not
+    // having permission to edit any story content.
     $node_update = array(
       'node[title]' => 'testing',
       'node[body]' => 'bodytest',
       'node[type]' => 'story',
     );
-    
     $data = $this->services_build_postfields($node_update);
-    $responseArray = $this->servicesPut($endpoint->path.'/node/'.$node->nid, $data, array('Accept: application/json'));
-    $nodeResourceUpdateReturn = json_decode($responseArray['body']);
-    $nodeAfterUpdate = node_load($nodeResourceUpdateReturn);
-    if(isset($nodeAfterUpdate->nid)) {
-      $this->fail(t('Updating the node failed. StatusCode: !status', array('!status' => $responseArray['status'])), 'NodeResource: Update');
-    } else {
-      $this->pass(t('Updating the node failed. This is good!'), 'NodeResource: Update');
-    }
+    $responseArray = $this->servicesPut($this->endpoint->path . '/node/' . $node->nid, $data, array('Accept: application/json'));
+
+    $this->assertTrue(strpos($responseArray['status'], 'Access denied for user'), t('Updating the node failed without needed permissions. This is good!'), 'NodeResource: Update');
   }
   /**
     * testing node_resource Update verify missing title
@@ -256,21 +214,18 @@ require_once('ServicesWebTestCase.php') ;
        'administer nodes',
     ));
     $this->drupalLogin($this->privilegedUser);
-    $endpoint =  $this->saveNewEndpoint();
     $node = $this->drupalCreateNode();
     $node_update = array(
       'node[title]' => '',
       'node[body]' => 'bodytest',
       'node[name]' => $this->privilegedUser->name,
     );
-    
+
     $data = $this->services_build_postfields($node_update);
-    $responseArray = $this->servicesPut($endpoint->path.'/node/'.$node->nid, $data, array('Accept: application/json'));
+    $responseArray = $this->servicesPut($this->endpoint->path . '/node/' . $node->nid, $data, array('Accept: application/json'));
     $nodeResourceUpdateReturn = json_decode($responseArray['body']);
     $nodeAfterUpdate = node_load($nodeResourceUpdateReturn);
-    if(strpos($responseArray['status'], 'Title field is required.')) {
-      $this->pass('Node was not created, no title. ', 'NodeResource: Update');
-    }
+    $this->assertTrue(strpos($responseArray['status'], 'Title field is required.'), t('Node was not updated without title.'), 'NodeResource: Update');
   }
   /**
     * testing node_resource Delete
@@ -282,22 +237,15 @@ require_once('ServicesWebTestCase.php') ;
        'administer nodes',
     ));
     $this->drupalLogin($this->privilegedUser);
-    $endpoint =  $this->saveNewEndpoint();
     $node = $this->drupalCreateNode();
     $data = '';
-    $responseArray = $this->servicesDelete($endpoint->path.'/node/'.$node->nid, $data, array('Accept: application/json'));
+    $responseArray = $this->servicesDelete($this->endpoint->path . '/node/' . $node->nid, $data, array('Accept: application/json'));
     $nodeResourceUpdateReturn = json_decode($responseArray['body']);
-    if($responseArray['code'] == 200) {
-      $this->pass('Node was deleted.', 'NodeResource: Deleted');
-    } else {
-      $this->fail(t('Deleting the node failed. StatusCode: !status', array('!status' => $responseArray['status'])), 'NodeResource: Delete');
-    }
-    $responseArray = $this->servicesDelete($endpoint->path.'/node/'.$node->nid, $data, array('Accept: application/json'));
+    $this->assertTrue($responseArray['code'] == 200, t('Node was deleted.'), 'NodeResource: Deleted');
+
+    $responseArray = $this->servicesDelete($this->endpoint->path . '/node/' . $node->nid, $data, array('Accept: application/json'));
     $nodeResourceUpdateReturn = json_decode($responseArray['body']);
-    if($responseArray['code'] == 200) {
-      $this->fail('Node was deleted. It shoudlnt have been because it doesnt exist', 'NodeResource: Deleted');
-    } else {
-      $this->pass(t('Was not abled to delete node because it doesnt exist. StatusCode: !status', array('!status' => $responseArray['status'])), 'NodeResource: Delete');
-    }
+
+    $this->assertFalse($responseArray['code'] == 200, t('Node was deleted. It shoudlnt have been because it doesnt exist'), 'NodeResource: Deleted');
   }
-}
\ No newline at end of file
+}
diff --git tests/functional/ServicesWebTestCase.php tests/functional/ServicesWebTestCase.php
index 871d04b..8bfb5c3 100644
--- tests/functional/ServicesWebTestCase.php
+++ tests/functional/ServicesWebTestCase.php
@@ -7,9 +7,9 @@
     $content = $this->curlExec(array(CURLOPT_HTTPGET => TRUE, CURLOPT_URL => url($url, $options), CURLOPT_NOBODY => FALSE, CURLOPT_RETURNTRANSFER => TRUE, CURLOPT_HEADER => TRUE, CURLOPT_HTTPHEADER => array("Accept: application/json")));
     $info = curl_getinfo($this->curlHandle);
     $header = substr($content, 0, $info['header_size']);
-    $status = strtok($header, "\r\n");  
+    $status = strtok($header, "\r\n");
     $code = $info['http_code'];
-    $body = substr($content, -$info['download_content_length']);  
+    $body = substr($content, -$info['download_content_length']);
     $this->verbose('GET request to: ' . $url .
                    '<hr />Ending URL: ' . $this->getUrl() .
                    '<hr />' . $content);
@@ -22,9 +22,9 @@
     $content = $this->curlExec(array(CURLOPT_URL => $url, CURLOPT_POST => TRUE, CURLOPT_POSTFIELDS => $data, CURLOPT_HTTPHEADER => $headers, CURLOPT_RETURNTRANSFER => TRUE));
     $info = curl_getinfo($this->curlHandle);
     $header = substr($content, 0, $info['header_size']);
-    $status = strtok($header, "\r\n");  
+    $status = strtok($header, "\r\n");
     $code = $info['http_code'];
-    $body = substr($content, -$info['download_content_length']);  
+    $body = substr($content, -$info['download_content_length']);
     $this->verbose('POST request to: ' . $url .
                     'data: ' . $data .
                    '<hr />Ending URL: ' . $this->getUrl() .
@@ -42,9 +42,9 @@
     $content = $this->curlExec(array(CURLOPT_URL => $url,CURLOPT_RETURNTRANSFER => TRUE, CURLOPT_CUSTOMREQUEST => "PUT", CURLOPT_POSTFIELDS => $data, CURLOPT_HTTPHEADER => $headers, CURLOPT_INFILE =>$putData, CURLOPT_INFILESIZE => strlen($data)));
     $info = curl_getinfo($this->curlHandle);
     $header = substr($content, 0, $info['header_size']);
-    $status = strtok($header, "\r\n");  
+    $status = strtok($header, "\r\n");
     $code = $info['http_code'];
-    $body = substr($content, -$info['download_content_length']);  
+    $body = substr($content, -$info['download_content_length']);
     $this->verbose('PUT request to: ' . $url .
                     'data: ' . $data .
                    '<hr />Ending URL: ' . $this->getUrl() .
@@ -59,9 +59,9 @@
     $content = $this->curlExec(array(CURLOPT_URL => $url, CURLOPT_CUSTOMREQUEST => "DELETE", CURLOPT_HTTPHEADER => $headers, CURLOPT_RETURNTRANSFER => TRUE));
     $info = curl_getinfo($this->curlHandle);
     $header = substr($content, 0, $info['header_size']);
-    $status = strtok($header, "\r\n");  
+    $status = strtok($header, "\r\n");
     $code = $info['http_code'];
-    $body = substr($content, -$info['download_content_length']);  
+    $body = substr($content, -$info['download_content_length']);
     $this->verbose('DELETE request to: ' . $url .
                     'data: ' . $data .
                    '<hr />Ending URL: ' . $this->getUrl() .
@@ -271,9 +271,9 @@
     services_endpoint_save($endpoint);
     $endpoint = services_endpoint_load($endpoint->name);
     if($endpoint->name == $edit['name']) {
-      $this->pass('Endpoint successfully created');  
+      $this->pass('Endpoint successfully created');
     } else {
-       $this->fail('Endpoint creation failed');  
+       $this->fail('Endpoint creation failed');
     }
      $this->servicesGet($endpoint->path);
      return $endpoint;
@@ -283,7 +283,7 @@
  *
  */
   public function services_build_postfields($data = array()) {
-    $post_data = '';  
+    $post_data = '';
     if (is_array($data) && !empty($data)) {
       array_walk($data, array($this, 'services_flatten_fields'));
       $post_data = implode('&', $data);
@@ -296,12 +296,67 @@
   }
 /**
  * Modifies our array data so we can turn it into a querystring
- * 
+ *
  * @param string $item - array value
  * @param string $key  - key of the array element
  */
   public function services_flatten_fields(&$item, $key) {
     $item = $key .'='. $item;
   }
+
+  /**
+   * Performs a cURL exec with the specified options after calling curlConnect().
+   *
+   * @param $curl_options
+   *   Custom cURL options.
+   * @return
+   *   Content returned from the exec.
+   */
+  protected function curlExec($curl_options) {
+    $this->curlInitialize();
+    $url = empty($curl_options[CURLOPT_URL]) ? curl_getinfo($this->curlHandle, CURLINFO_EFFECTIVE_URL) : $curl_options[CURLOPT_URL];
+    if (!empty($curl_options[CURLOPT_POST])) {
+      // This is a fix for the Curl library to prevent Expect: 100-continue
+      // headers in POST requests, that may cause unexpected HTTP response
+      // codes from some webservers (like lighttpd that returns a 417 error
+      // code). It is done by setting an empty "Expect" header field that is
+      // not overwritten by Curl.
+      $curl_options[CURLOPT_HTTPHEADER][] = 'Expect:';
+    }
+    curl_setopt_array($this->curlHandle, $this->additionalCurlOptions + $curl_options);
+
+    // Reset headers and the session ID.
+    $this->session_id = NULL;
+    $this->headers = array();
+
+    $this->drupalSetContent(curl_exec($this->curlHandle), curl_getinfo($this->curlHandle, CURLINFO_EFFECTIVE_URL));
+
+    // Analyze the method for log message.
+    $method = '';
+    if (!empty($curl_options[CURLOPT_NOBODY])) {
+      $method = 'HEAD';
+    }
+
+    if (empty($method) && !empty($curl_options[CURLOPT_PUT])) {
+      $method = 'PUT';
+    }
+
+    if (empty($method) && !empty($curl_options[CURLOPT_CUSTOMREQUEST])) {
+      $method = $curl_options[CURLOPT_CUSTOMREQUEST];
+    }
+
+    if (empty($method)) {
+      $method = empty($curl_options[CURLOPT_POSTFIELDS]) ? 'GET' : 'POST';
+    }
+
+    $message_vars = array(
+      '!method' => $method,
+      '@url'    => $url,
+      '@status' => curl_getinfo($this->curlHandle, CURLINFO_HTTP_CODE),
+      '!length' => format_size(strlen($this->content))
+    );
+    $message = t('!method @url returned @status (!length).', $message_vars);
+    $this->assertTrue($this->content !== FALSE, $message, t('Browser'));
+    return $this->drupalGetContent();
+  }
 }
-?>
\ No newline at end of file
