   _onGetReadingError: (reading) =>
     @error "Unable to create reading for this book"
 
+  _onCreateHighlight: (annotation, data) ->
+    annotation.highlightUrl = data.location
+
   _onAnnotationCreated: (annotation) =>
     if @client.isAuthorized() and @book.id
-      @client.createHighlight()
+      url = @book.reading.highlights
+      comment = @_commentFromAnnotation annotation
+      highlight = @_highlightFromAnnotation annotation
+      request = @client.createHighlight url, highlight, comment
+      request.then jQuery.proxy(this, "_onCreateHighlight", annotation), =>
+        @error "Unable to send annotation to Readmill"
     else
       @unsaved.push annotation
       @connect() unless @client.isAuthorized()

  error: (message) ->
    Annotator.showNotification message, Annotator.Notification.ERROR

  _onConnectSuccess: (params) =>
    @connected params.access_token, params


  getHighlights: (url) ->
    @request url: url, type: "GET"

  createHighlight: (url, highlight, comment) ->
    @request type: "POST", url: url, data: {highlight: highlight, comment: comment}

  updateHighlight: ->

