diff --git a/gemeinsamforschen/src/main/webapp/assets/js/annotationRest.js b/gemeinsamforschen/src/main/webapp/assets/js/annotationRest.js
new file mode 100644
index 0000000000000000000000000000000000000000..a270ce790229156911ef0974a2e873d82c70b058
--- /dev/null
+++ b/gemeinsamforschen/src/main/webapp/assets/js/annotationRest.js
@@ -0,0 +1,83 @@
+/**
+ * POST: Save an annotation in the database
+ *
+ * @param annotationPostRequest The post request
+ * @param responseHandler The response handler
+ */
+function createAnnotation(annotationPostRequest, responseHandler) {
+    var url = "../rest/annotations/";
+    var json = JSON.stringify(annotationPostRequest);
+    $.ajax({
+        url: url,
+        type: "POST",
+        data: json,
+        contentType: "application/json",
+        dataType: "json",
+        success: function (response) {
+            responseHandler(response);
+        }
+    });
+}
+
+/**
+ * PATCH: Alter an annotation in database
+ *
+ * @param id The annotation id
+ * @param annotationPatchRequest The patch request
+ * @param responseHandler The response handler
+ */
+function alterAnnotation(id, annotationPatchRequest, responseHandler) {
+    var url = "../rest/annotations/" + id;
+    var json = JSON.stringify(annotationPatchRequest);
+    $.ajax({
+        url: url,
+        type: "PATCH",
+        data: json,
+        contentType: "application/json",
+        dataType: "json",
+        success: function (response) {
+            responseHandler(response);
+        }
+    });
+}
+
+/**
+ * DELETE: Delete an annotation from database
+ *
+ * @param id The annotation id
+ */
+function deleteAnnotation(id, responseHandler) {
+    var url = "../rest/annotations/" + id;
+    $.ajax({
+        url: url,
+        type: "DELETE",
+        dataType: "json",
+        success: function (response) {
+            responseHandler(response)
+        }
+    });
+}
+
+/**
+ * GET: Get all annotations from database for a specific target
+ *
+ *
+ * @param targetId The target id
+ * @param responseHandler The response handler
+ */
+function getAnnotations(targetId, responseHandler) {
+    var url = "../rest/annotations/target/" + targetId;
+    $.ajax({
+        url: url,
+        type: "GET",
+        dataType: "json",
+        success: function (response) {
+            // sort the responding annotations by timestamp (DESC)
+            response.sort(function (a, b) {
+                return a.timestamp - b.timestamp;
+            });
+            // handle the response
+            responseHandler(response);
+        }
+    });
+}
\ No newline at end of file
diff --git a/gemeinsamforschen/src/main/webapp/assets/js/annotationScript.js b/gemeinsamforschen/src/main/webapp/assets/js/annotationScript.js
index 0a4f4214503add3745e39a4ac7bf23934de5bcbb..1dc1882e354e6fede09e400125cec30b378a00d4 100644
--- a/gemeinsamforschen/src/main/webapp/assets/js/annotationScript.js
+++ b/gemeinsamforschen/src/main/webapp/assets/js/annotationScript.js
@@ -12,7 +12,8 @@ var documentText, startCharacter, endCharacter;
  */
 $(document).ready(function() {
 
-    connect("200");
+    // connect to websocket on page ready
+    connect(targetId);
 
     /**
      * Context menu handler
@@ -217,90 +218,6 @@ $( window ).resize(function() {
     showAndHideToggleButton();
 });
 
-/**
- * POST: Save an annotation in the database
- *
- * @param annotationPostRequest The post request
- * @param responseHandler The response handler
- */
-function createAnnotation(annotationPostRequest, responseHandler) {
-    var url = "../rest/annotations/";
-    var json = JSON.stringify(annotationPostRequest);
-    $.ajax({
-        url: url,
-        type: "POST",
-        data: json,
-        contentType: "application/json",
-        dataType: "json",
-        success: function (response) {
-            responseHandler(response);
-        }
-    });
-}
-
-/**
- * PATCH: Alter an annotation in database
- *
- * @param id The annotation id
- * @param annotationPatchRequest The patch request
- * @param responseHandler The response handler
- */
-function alterAnnotation(id, annotationPatchRequest, responseHandler) {
-    var url = "../rest/annotations/" + id;
-    var json = JSON.stringify(annotationPatchRequest);
-    $.ajax({
-        url: url,
-        type: "PATCH",
-        data: json,
-        contentType: "application/json",
-        dataType: "json",
-        success: function (response) {
-            responseHandler(response);
-        }
-    });
-}
-
-/**
- * DELETE: Delete an annotation from database
- *
- * @param id The annotation id
- */
-function deleteAnnotation(id, responseHandler) {
-    var url = "../rest/annotations/" + id;
-    $.ajax({
-        url: url,
-        type: "DELETE",
-        dataType: "json",
-        success: function (response) {
-            responseHandler(response)
-        }
-    });
-}
-
-/**
- * GET: Get all annotations from database for a specific target
- *
- *
- * @param targetId The target id
- * @param responseHandler The response handler
- */
-function getAnnotations(targetId, responseHandler) {
-    var url = "../rest/annotations/target/" + targetId;
-    $.ajax({
-        url: url,
-        type: "GET",
-        dataType: "json",
-        success: function (response) {
-            // sort the responding annotations by timestamp (DESC)
-            response.sort(function (a, b) {
-                return a.timestamp - b.timestamp;
-            });
-            // handle the response
-            responseHandler(response);
-        }
-    });
-}
-
 /**
  * Display annotation in the list
  *
diff --git a/gemeinsamforschen/src/main/webapp/pages/annotation-document.jsp b/gemeinsamforschen/src/main/webapp/pages/annotation-document.jsp
index 4d8fc1a2faf5fca6922f567b84d07a345c7d3aa9..de317f500d73c07fc90840a63303ec3c5c36889e 100644
--- a/gemeinsamforschen/src/main/webapp/pages/annotation-document.jsp
+++ b/gemeinsamforschen/src/main/webapp/pages/annotation-document.jsp
@@ -36,6 +36,8 @@
     <script src="../assets/js/utility.js"></script>
     <!-- js - annotation websocket script -->
     <script src="../assets/js/annotationWebsocket.js"></script>
+    <!-- js - annotation REST script -->
+    <script src="../assets/js/annotationRest.js"></script>
     <!-- js - annotationScript -->
     <script src="../assets/js/annotationScript.js"></script>