title: NodeJS and Backbone's fetch
body: <p>This is my front-end code (using <code>fetch</code>)</p>
  
  <pre><code>    var MyModel = Backbone.Model.extend();
      var MyCollection = Backbone.Collection.extend({
          url: '/questions',
          model: MyModel
      });
      var coll = new MyCollection();
      coll.fetch({
          error: function (collection, response) {
              console.log('error', response);
          },
          success: function (collection, response) {
              console.log('success', response);
          }
      });
  </code></pre>
  
  <p>and this is my back-end code (using <code>app.get</code>)</p>
  
  <pre><code>app.get('/questions', function (request, response) {
      console.log('Inside /questions');
      response.writeHead(200, {
          'Content-Type': 'text/json'
      });
      response.write('{test:1}');
      response.end();
  });
  </code></pre>
  
  <p>The problem is that although the response is as expected, the client-side <code>error</code> callback is called. When I remove the line <code>response.write('{test:1}');</code>, the <code>success</code> callback is called. Any ideas as to what I might be doing wrong?</p>