[UNOMI-449] Use new endpoints internally (mostly in tests and documentation) (#284)

diff --git a/extensions/web-tracker/javascript/src/analytics.js-integration-apache-unomi.js b/extensions/web-tracker/javascript/src/analytics.js-integration-apache-unomi.js
index 8a4f587..631e3b8 100644
--- a/extensions/web-tracker/javascript/src/analytics.js-integration-apache-unomi.js
+++ b/extensions/web-tracker/javascript/src/analytics.js-integration-apache-unomi.js
@@ -234,7 +234,7 @@
 
     jsonData.sessionId = this.sessionId;
 
-    var contextUrl = this.options.url + '/context.json';
+    var contextUrl = this.options.url + '/cxs/context.json';
     if (invalidate) {
         contextUrl += '?invalidateSession=true&invalidateProfile=true';
     }
@@ -403,7 +403,7 @@
 
     var data = JSON.stringify(events);
     this.ajax({
-        url: this.options.url + '/eventcollector',
+        url: this.options.url + '/cxs/eventcollector',
         type: 'POST',
         async: true,
         contentType: 'text/plain;charset=UTF-8', // Use text/plain to avoid CORS preflight
diff --git a/itests/src/test/java/org/apache/unomi/itests/BasicIT.java b/itests/src/test/java/org/apache/unomi/itests/BasicIT.java
index 64286b8..b40ecb8 100644
--- a/itests/src/test/java/org/apache/unomi/itests/BasicIT.java
+++ b/itests/src/test/java/org/apache/unomi/itests/BasicIT.java
@@ -25,18 +25,19 @@
 import org.apache.http.client.methods.HttpUriRequest;
 import org.apache.http.entity.ContentType;
 import org.apache.http.entity.StringEntity;
-import org.apache.http.impl.client.HttpClientBuilder;
 import org.apache.http.util.EntityUtils;
-import org.apache.unomi.api.*;
+import org.apache.unomi.api.ContextRequest;
+import org.apache.unomi.api.CustomItem;
+import org.apache.unomi.api.Event;
+import org.apache.unomi.api.Profile;
 import org.apache.unomi.api.conditions.ConditionType;
 import org.apache.unomi.api.rules.Rule;
 import org.apache.unomi.api.services.DefinitionsService;
 import org.apache.unomi.api.services.ProfileService;
 import org.apache.unomi.api.services.RulesService;
-import org.apache.unomi.lifecycle.BundleWatcher;
+import org.apache.unomi.itests.tools.httpclient.HttpClientThatWaitsForUnomi;
 import org.apache.unomi.persistence.spi.CustomObjectMapper;
 import org.junit.Assert;
-import org.junit.Before;
 import org.junit.Test;
 import org.junit.runner.RunWith;
 import org.ops4j.pax.exam.junit.PaxExam;
@@ -96,7 +97,8 @@
     @Test
     public void testContextJS() throws IOException {
         LOGGER.info("Start test testContextJS");
-        HttpUriRequest request = new HttpGet(URL + "/context.js?sessionId=" + SESSION_ID_0);
+        HttpUriRequest request = new HttpGet(URL + "/cxs/context.js?sessionId=" + SESSION_ID_0);
+        request.setHeader("Content-Type", "application/json");
         // The underlying HTTP connection is still held by the response object
         // to allow the response content to be streamed directly from the network socket.
         // In order to ensure correct deallocation of system resources
@@ -105,7 +107,7 @@
         // connection cannot be safely re-used and will be shut down and discarded
         // by the connection manager.
         String responseContent;
-        try (CloseableHttpResponse response = HttpClientBuilder.create().build().execute(request)) {
+        try (CloseableHttpResponse response = HttpClientThatWaitsForUnomi.doRequest(request)) {
             HttpEntity entity = response.getEntity();
             // do something useful with the response body
             // and ensure it is fully consumed
@@ -120,7 +122,7 @@
     public void testContextJSONWithUrlParameter() throws IOException, InterruptedException {
         LOGGER.info("Start test testContextJSONWithUrlParameter");
         ContextRequest contextRequest = new ContextRequest();
-        HttpPost request = new HttpPost(URL + "/context.json?sessionId=" + SESSION_ID_1);
+        HttpPost request = new HttpPost(URL + "/cxs/context.json?sessionId=" + SESSION_ID_1);
         request.setEntity(new StringEntity(objectMapper.writeValueAsString(contextRequest), ContentType.create("application/json")));
 
         executeContextJSONRequest(request, SESSION_ID_1);
@@ -132,7 +134,7 @@
         LOGGER.info("Start test testContextJSON");
         ContextRequest contextRequest = new ContextRequest();
         contextRequest.setSessionId(SESSION_ID_2);
-        HttpPost request = new HttpPost(URL + "/context.json");
+        HttpPost request = new HttpPost(URL + "/cxs/context.json");
         request.setEntity(new StringEntity(objectMapper.writeValueAsString(contextRequest), ContentType.create("application/json")));
 
         executeContextJSONRequest(request, SESSION_ID_2);
@@ -158,7 +160,7 @@
 
         // First page view with the first visitor aka VISITOR_1 and SESSION_ID_3
         ContextRequest contextRequestPageViewSession1 = getContextRequestWithPageViewEvent(sourceSite, SESSION_ID_3);
-        HttpPost requestPageView1 = new HttpPost(URL + "/context.json");
+        HttpPost requestPageView1 = new HttpPost(URL + "/cxs/context.json");
         requestPageView1.setEntity(new StringEntity(objectMapper.writeValueAsString(contextRequestPageViewSession1),
                 ContentType.create("application/json")));
         TestUtils.RequestResponse requestResponsePageView1 = executeContextJSONRequest(requestPageView1, SESSION_ID_3);
@@ -174,7 +176,7 @@
         // Create login event with VISITOR_1
         ContextRequest contextRequestLoginVisitor1 = getContextRequestWithLoginEvent(sourceSite, loginEventPropertiesVisitor1,
                 EMAIL_VISITOR_1, SESSION_ID_3);
-        HttpPost requestLoginVisitor1 = new HttpPost(URL + "/context.json");
+        HttpPost requestLoginVisitor1 = new HttpPost(URL + "/cxs/context.json");
         requestLoginVisitor1.addHeader("Cookie", requestResponsePageView1.getCookieHeaderValue());
         requestLoginVisitor1.addHeader("X-Unomi-Peer", UNOMI_KEY);
         requestLoginVisitor1.setEntity(new StringEntity(objectMapper.writeValueAsString(contextRequestLoginVisitor1),
@@ -186,7 +188,7 @@
         Thread.sleep(1000);
 
         // Lets add a page view with VISITOR_1 to simulate reloading the page after login and be able to check the profile properties
-        HttpPost requestPageView2 = new HttpPost(URL + "/context.json");
+        HttpPost requestPageView2 = new HttpPost(URL + "/cxs/context.json");
         requestPageView2.addHeader("Cookie", requestResponsePageView1.getCookieHeaderValue());
         requestPageView2.setEntity(new StringEntity(objectMapper.writeValueAsString(contextRequestPageViewSession1),
                 ContentType.create("application/json")));
@@ -199,7 +201,7 @@
         // Lets simulate a logout by requesting the context with a new page view event and a new session id
         // but we will send the cookie of the profile id from VISITOR_1
         ContextRequest contextRequestPageViewSession2 = getContextRequestWithPageViewEvent(sourceSite, SESSION_ID_4);
-        HttpPost requestPageView3 = new HttpPost(URL + "/context.json");
+        HttpPost requestPageView3 = new HttpPost(URL + "/cxs/context.json");
         requestPageView3.addHeader("Cookie", requestResponsePageView1.getCookieHeaderValue());
         requestPageView3.setEntity(new StringEntity(objectMapper.writeValueAsString(contextRequestPageViewSession2),
                 ContentType.create("application/json")));
@@ -218,7 +220,7 @@
         // Create login event with VISITOR_2
         ContextRequest contextRequestLoginVisitor2 = getContextRequestWithLoginEvent(sourceSite, loginEventPropertiesVisitor2,
                 EMAIL_VISITOR_2, SESSION_ID_4);
-        HttpPost requestLoginVisitor2 = new HttpPost(URL + "/context.json");
+        HttpPost requestLoginVisitor2 = new HttpPost(URL + "/cxs/context.json");
         requestLoginVisitor2.addHeader("Cookie", requestResponsePageView1.getCookieHeaderValue());
         requestLoginVisitor2.addHeader("X-Unomi-Peer", UNOMI_KEY);
         requestLoginVisitor2.setEntity(new StringEntity(objectMapper.writeValueAsString(contextRequestLoginVisitor2),
@@ -232,7 +234,7 @@
         Thread.sleep(1000);
 
         // Lets add a page view with VISITOR_2 to simulate reloading the page after login
-        HttpPost requestPageView4 = new HttpPost(URL + "/context.json");
+        HttpPost requestPageView4 = new HttpPost(URL + "/cxs/context.json");
         requestPageView4.addHeader("Cookie", requestResponseLoginVisitor2.getCookieHeaderValue());
         requestPageView4.setEntity(new StringEntity(objectMapper.writeValueAsString(contextRequestPageViewSession2),
                 ContentType.create("application/json")));
diff --git a/itests/src/test/java/org/apache/unomi/itests/ContextServletIT.java b/itests/src/test/java/org/apache/unomi/itests/ContextServletIT.java
index 9d5d06e..4ebcfad 100644
--- a/itests/src/test/java/org/apache/unomi/itests/ContextServletIT.java
+++ b/itests/src/test/java/org/apache/unomi/itests/ContextServletIT.java
@@ -21,14 +21,7 @@
 import org.apache.http.client.methods.HttpPost;
 import org.apache.http.entity.ContentType;
 import org.apache.http.entity.StringEntity;
-import org.apache.unomi.api.ContextRequest;
-import org.apache.unomi.api.ContextResponse;
-import org.apache.unomi.api.Event;
-import org.apache.unomi.api.EventType;
-import org.apache.unomi.api.Metadata;
-import org.apache.unomi.api.Profile;
-import org.apache.unomi.api.PropertyType;
-import org.apache.unomi.api.Session;
+import org.apache.unomi.api.*;
 import org.apache.unomi.api.conditions.Condition;
 import org.apache.unomi.api.segments.Segment;
 import org.apache.unomi.api.services.DefinitionsService;
@@ -52,18 +45,10 @@
 import java.time.LocalDateTime;
 import java.time.ZoneId;
 import java.time.ZoneOffset;
-import java.util.Arrays;
-import java.util.Date;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Map;
-import java.util.Set;
+import java.util.*;
 
 import static org.hamcrest.core.IsCollectionContaining.hasItem;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNull;
-import static org.junit.Assert.assertThat;
+import static org.junit.Assert.*;
 
 
 /**
@@ -73,7 +58,7 @@
 @RunWith(PaxExam.class)
 @ExamReactorStrategy(PerSuite.class)
 public class ContextServletIT extends BaseIT {
-    private final static String CONTEXT_URL = "/context.json";
+    private final static String CONTEXT_URL = "/cxs/context.json";
     private final static String THIRD_PARTY_HEADER_NAME = "X-Unomi-Peer";
     private final static String SEGMENT_EVENT_TYPE = "test-event-type";
     private final static String SEGMENT_ID = "test-segment-id";
diff --git a/itests/src/test/java/org/apache/unomi/itests/SecurityIT.java b/itests/src/test/java/org/apache/unomi/itests/SecurityIT.java
index f423622..23ad4d8 100644
--- a/itests/src/test/java/org/apache/unomi/itests/SecurityIT.java
+++ b/itests/src/test/java/org/apache/unomi/itests/SecurityIT.java
@@ -23,7 +23,6 @@
 import org.apache.unomi.api.ContextRequest;
 import org.apache.unomi.api.conditions.Condition;
 import org.apache.unomi.api.services.PersonalizationService;
-import org.apache.unomi.lifecycle.BundleWatcher;
 import org.apache.unomi.persistence.spi.CustomObjectMapper;
 import org.junit.Before;
 import org.junit.Test;
@@ -31,11 +30,7 @@
 import org.ops4j.pax.exam.junit.PaxExam;
 import org.ops4j.pax.exam.spi.reactors.ExamReactorStrategy;
 import org.ops4j.pax.exam.spi.reactors.PerSuite;
-import org.ops4j.pax.exam.util.Filter;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
 
-import javax.inject.Inject;
 import java.io.File;
 import java.io.IOException;
 import java.util.ArrayList;
@@ -95,7 +90,7 @@
         contextRequest.setPersonalizations(personalizations);
 
         contextRequest.setSessionId(SESSION_ID);
-        HttpPost request = new HttpPost(URL + "/context.json");
+        HttpPost request = new HttpPost(URL + "/cxs/context.json");
         request.setEntity(new StringEntity(objectMapper.writeValueAsString(contextRequest), ContentType.create("application/json")));
 
         TestUtils.RequestResponse response = executeContextJSONRequest(request, SESSION_ID);
diff --git a/itests/src/test/java/org/apache/unomi/itests/TestUtils.java b/itests/src/test/java/org/apache/unomi/itests/TestUtils.java
index 1045d12..b216ef2 100644
--- a/itests/src/test/java/org/apache/unomi/itests/TestUtils.java
+++ b/itests/src/test/java/org/apache/unomi/itests/TestUtils.java
@@ -64,7 +64,7 @@
 	}
 
 	public static RequestResponse executeContextJSONRequest(HttpPost request, String sessionId) throws IOException {
-		try (CloseableHttpResponse response = HttpClientThatWaitsForUnomi.doPost(request)) {
+		try (CloseableHttpResponse response = HttpClientThatWaitsForUnomi.doRequest(request)) {
 			// validate mimeType
 			HttpEntity entity = response.getEntity();
 			String mimeType = ContentType.getOrDefault(entity).getMimeType();
diff --git a/itests/src/test/java/org/apache/unomi/itests/tools/httpclient/HttpClientThatWaitsForUnomi.java b/itests/src/test/java/org/apache/unomi/itests/tools/httpclient/HttpClientThatWaitsForUnomi.java
index 9685c01..d5cbf4d 100644
--- a/itests/src/test/java/org/apache/unomi/itests/tools/httpclient/HttpClientThatWaitsForUnomi.java
+++ b/itests/src/test/java/org/apache/unomi/itests/tools/httpclient/HttpClientThatWaitsForUnomi.java
@@ -18,7 +18,7 @@
 package org.apache.unomi.itests.tools.httpclient;
 
 import org.apache.http.client.methods.CloseableHttpResponse;
-import org.apache.http.client.methods.HttpPost;
+import org.apache.http.client.methods.HttpUriRequest;
 import org.apache.http.impl.client.HttpClientBuilder;
 import org.eclipse.jetty.http.HttpStatus;
 
@@ -29,7 +29,7 @@
     private static final long TIMER = 1000L;
     private static final int MAX_TRIES = 10;
 
-    public static CloseableHttpResponse doPost(HttpPost request) throws IOException {
+    public static CloseableHttpResponse doRequest(HttpUriRequest request) throws IOException {
         int count = 0;
         while (true) {
             CloseableHttpResponse response = HttpClientBuilder.create().build().execute(request);
@@ -37,7 +37,7 @@
             if (statusCode < HttpStatus.BAD_REQUEST_400) {
                 return response;
             }
-            if (count++ > MAX_TRIES || statusCode > HttpStatus.INTERNAL_SERVER_ERROR_500) {
+            if (count++ > MAX_TRIES || statusCode >= HttpStatus.INTERNAL_SERVER_ERROR_500) {
                 throw new RuntimeException(String.format("connecting to the server failed %s times with status %s %s", MAX_TRIES, statusCode, response.getStatusLine().getReasonPhrase()));
             }
             try {
diff --git a/manual/src/archives/1.1/asciidoc/building-and-deploying.adoc b/manual/src/archives/1.1/asciidoc/building-and-deploying.adoc
index 04add15..5bd4198 100644
--- a/manual/src/archives/1.1/asciidoc/building-and-deploying.adoc
+++ b/manual/src/archives/1.1/asciidoc/building-and-deploying.adoc
@@ -25,7 +25,7 @@
 (see "Deploying the generated package") or a KAR file that you can then deploy using a manual deployment process into
 an already installed Apache Karaf server (see "Deploying into an existing Karaf server")
 
-If you want to build and run the integration tests, you should instead use : 
+If you want to build and run the integration tests, you should instead use :
 
 [source]
 ----
@@ -38,14 +38,14 @@
 Simply uncompress the `package/target/unomi-VERSION.tar.gz` (for Linux or Mac OS X) or
  `package/target/unomi-VERSION.zip` (for Windows) archive into the directory of your choice.
 
-You can then start the server simply by using the command on UNIX/Linux/MacOS X : 
+You can then start the server simply by using the command on UNIX/Linux/MacOS X :
 
 [source]
 ----
 ./bin/karaf
 ----
 
-or on Windows shell : 
+or on Windows shell :
 
 [source]
 ----
@@ -61,7 +61,7 @@
  - Apache Karaf 3.0.2+, http://karaf.apache.org[http://karaf.apache.org]
  - Local copy of the Elasticsearch ZIP package, available here : http://www.elasticsearch.org[http://www.elasticsearch.org]
 
-. 
+.
 
 Before deploying, make sure that you have Apache Karaf properly installed. You will also have to increase the
 default maximum memory size and perm gen size by adjusting the following environment values in the bin/setenv(.bat)
@@ -76,14 +76,14 @@
    export JAVA_MAX_PERM_MEM=384M
 ----
 
-. 
+.
 
 You will also need to have the Hyperic Sigar native libraries in your Karaf installation, so in order to this
 go to the Elasticsearch website (http://www.elasticsearch.org[http://www.elasticsearch.org]) and download the ZIP package. Decompress it somewhere
 on your disk and copy all the files from the lib/sigar directory into Karaf's lib/sigar directory
 (must be created first) EXCEPT THE SIGAR.JAR file.
 
-. 
+.
 
 Install the WAR support, CXF into Karaf by doing the following in the Karaf command line:
 
@@ -94,7 +94,7 @@
    feature:install -v cxf/2.7.11
 ----
 
-. 
+.
 
 Create a new $MY_KARAF_HOME/etc/org.apache.cxf.osgi.cfg file and put the following property inside :
 
@@ -103,7 +103,7 @@
    org.apache.cxf.servlet.context=/cxs
 ----
 
-. 
+.
 
 Copy the following KAR to the Karaf deploy directory, as in this example line:
 
@@ -112,7 +112,7 @@
   cp kar/target/unomi-kar-1.0.0-SNAPSHOT.kar ~/java/deployments/unomi/apache-karaf-3.0.1/deploy/
 ----
 
-. 
+.
 
 If all went smoothly, you should be able to access the context script here : http://localhost:8181/cxs/cluster[http://localhost:8181/cxs/cluster] .
  You should be able to login with karaf / karaf and see basic server information. If not something went wrong during the install.
@@ -120,14 +120,14 @@
 ==== JDK Selection on Mac OS X
 
 You might need to select the JDK to run the tests in the itests subproject. In order to do so you can list the
-installed JDKs with the following command : 
+installed JDKs with the following command :
 
 [source]
 ----
 /usr/libexec/java_home -V
 ----
 
-which will output something like this : 
+which will output something like this :
 
 [source]
 ----
@@ -141,21 +141,21 @@
     1.6.0_65-b14-462, i386: "Java SE 6" /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home
 ----
 
-You can then select the one you want using : 
+You can then select the one you want using :
 
 [source]
 ----
 export JAVA_HOME=`/usr/libexec/java_home -v 1.7.0_51`
 ----
 
-and then check that it was correctly referenced using: 
+and then check that it was correctly referenced using:
 
 [source]
 ----
 java -version
 ----
 
-which should give you a result such as this: 
+which should give you a result such as this:
 
 [source]
 ----
@@ -169,11 +169,11 @@
 The integration tests are not executed by default to make build time minimal, but it is recommended to run the
 integration tests at least once before using the server to make sure that everything is ok in the build. Another way
 to use these tests is to run them from a continuous integration server such as Jenkins, Apache Gump, Atlassian Bamboo or
- others. 
+ others.
 
 Note : the integration tests require a JDK 7 or more recent !
 
-To run the tests simply activate the following profile : 
+To run the tests simply activate the following profile :
 
 [source]
 ----
@@ -207,7 +207,7 @@
    http://localhost:8181/index.html
 ----
 
-This test page will trigger the loading of the /context.js script, which will try to retrieving the user context
+This test page will trigger the loading of the /cxs/context.js script, which will try to retrieving the user context
 or create a new one if it doesn't exist yet. It also contains an experimental integration with Facebook Login, but it
 doesn't yet save the context back to the context server.
 
@@ -222,4 +222,4 @@
     var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0]; g.type='text/javascript'; g.defer=true; g.async=true; g.src=u+'context.js';
     s.parentNode.insertBefore(g,s); })();
 </script>
-----
\ No newline at end of file
+----
diff --git a/manual/src/archives/1.1/asciidoc/configuration.adoc b/manual/src/archives/1.1/asciidoc/configuration.adoc
index e9f4353..0f26839 100644
--- a/manual/src/archives/1.1/asciidoc/configuration.adoc
+++ b/manual/src/archives/1.1/asciidoc/configuration.adoc
@@ -33,7 +33,7 @@
 If you need to specify an Elasticsearch cluster name that is different than the default, it is recommended to do this
 BEFORE you start the server for the first time, or you will loose all the data you have stored previously.
 
-To change the cluster name, first create a file called 
+To change the cluster name, first create a file called
 
 [source]
 ----
@@ -85,13 +85,13 @@
 
 The generated package is also configured with a default SSL certificate. You can change it by following these steps :
 
-. 
+.
 
 Replace the existing keystore in $MY_KARAF_HOME/etc/keystore by your own certificate :
 
 http://wiki.eclipse.org/Jetty/Howto/Configure_SSL[http://wiki.eclipse.org/Jetty/Howto/Configure_SSL]
 
-. 
+.
 
 Update the keystore and certificate password in $MY_KARAF_HOME/etc/custom.properties file :
 
@@ -124,24 +124,24 @@
 ==== Securing a production environment
 
 Before going live with a project, you should _absolutely_ read the following section that will help you setup a proper
-secure environment for running your context server. 
+secure environment for running your context server.
 
-Step 1: Install and configure a firewall 
+Step 1: Install and configure a firewall
 
 You should setup a firewall around your cluster of context servers and/or Elasticsearch nodes. If you have an
-application-level firewall you should only allow the following connections open to the whole world : 
+application-level firewall you should only allow the following connections open to the whole world :
 
-* http://localhost:8181/context.js[http://localhost:8181/context.js]
-* http://localhost:8181/eventcollector[http://localhost:8181/eventcollector]
+* http://localhost:8181/cxs/context.js[http://localhost:8181/cxs/context.js]
+* http://localhost:8181/cxs/eventcollector[http://localhost:8181/cxs/eventcollector]
 
 All other ports should not be accessible to the world.
 
 For your Context Server client applications (such as the Jahia CMS), you will need to make the following ports
-accessible : 
+accessible :
 
 [source]
 ----
-8181 (Context Server HTTP port) 
+8181 (Context Server HTTP port)
 9443 (Context Server HTTPS port)
 ----
 
@@ -149,11 +149,11 @@
 highly recommended that you design your client applications to use the HTTPS port for accessing the REST API.
 
 The user accounts to access the REST API are actually routed through Karaf's JAAS support, which you may find the
-documentation for here : 
+documentation for here :
 
 * http://karaf.apache.org/manual/latest/users-guide/security.html[http://karaf.apache.org/manual/latest/users-guide/security.html]
 
-The default username/password is 
+The default username/password is
 
 [source]
 ----
@@ -161,7 +161,7 @@
 ----
 
 You should really change this default username/password as soon as possible. To do so, simply modify the following
-file : 
+file :
 
 [source]
 ----
@@ -188,7 +188,7 @@
 (this is done using a custom plugin for Elasticsearch, that you may find here :
 https://git-wip-us.apache.org/repos/asf/incubator-unomi/context-server/persistence-elasticsearch/plugins/security[https://git-wip-us.apache.org/repos/asf/incubator-unomi/context-server/persistence-elasticsearch/plugins/security])
 
-You can adjust this setting by using the following setting in the $MY_KARAF_HOME/etc/elasticsearch.yml file : 
+You can adjust this setting by using the following setting in the $MY_KARAF_HOME/etc/elasticsearch.yml file :
 
 [source]
 ----
@@ -197,7 +197,7 @@
 
 Step 3 : Follow industry recommended best practices for securing Elasticsearch
 
-You may find more valuable recommendations here : 
+You may find more valuable recommendations here :
 
 * https://www.elastic.co/blog/found-elasticsearch-security[https://www.elastic.co/blog/found-elasticsearch-security]
 * https://www.elastic.co/blog/scripting-security[https://www.elastic.co/blog/scripting-security]
@@ -293,4 +293,4 @@
 
 ProxyPass / http://localhost:8181/ connectiontimeout=20 timeout=300 ttl=120
 ProxyPassReverse / http://localhost:8181/
-----
\ No newline at end of file
+----
diff --git a/manual/src/archives/1.1/asciidoc/getting-started.adoc b/manual/src/archives/1.1/asciidoc/getting-started.adoc
index 4ad0942..18ee5ef 100644
--- a/manual/src/archives/1.1/asciidoc/getting-started.adoc
+++ b/manual/src/archives/1.1/asciidoc/getting-started.adoc
@@ -45,7 +45,7 @@
 ----
 
 This indicates that all the Unomi services are started and ready to react to requests. You can then open a browser and go to `http://localhost:8181/cxs` to see the list of
-available RESTful services or retrieve an initial context at `http://localhost:8181/context.json` (which isn't very useful at this point).
+available RESTful services or retrieve an initial context at `http://localhost:8181/cxs/context.json` (which isn't very useful at this point).
 
 ===== Building the tweet button sample
 
@@ -88,7 +88,7 @@
 
 ==== Retrieving context information from Unomi using the context servlet
 
-Unomi provides two ways to retrieve context: either as a pure JSON object containing strictly context information or as a couple of JSON objects augmented with javascript functions that can be used to interact with the Unomi server using the `&lt;context server base URL&gt;/context.json` or `&lt;context server base URL&gt;/context.js` URLs, respectively.
+Unomi provides two ways to retrieve context: either as a pure JSON object containing strictly context information or as a couple of JSON objects augmented with javascript functions that can be used to interact with the Unomi server using the `&lt;context server base URL&gt;/cxs/context.json` or `&lt;context server base URL&gt;/context.js` URLs, respectively.
 
 Below is an example of asynchronously loading the initial context using the javascript version, assuming a default Unomi install running on `http://localhost:8181`:
 
@@ -100,7 +100,7 @@
     if (document.getElementById(id)) return;
     js = document.createElement(elementToCreate);
     js.id = id;
-    js.src = 'http://localhost:8181/context.js';
+    js.src = 'http://localhost:8181/cxs/context.js';
     fjs.parentNode.insertBefore(js, fjs);
 }(document, 'script', 'context'));
 
@@ -150,7 +150,7 @@
     var data = JSON.stringify(payload);
     // if we don't already have a session id, generate one
     var sessionId = cxs.sessionId || generateUUID();
-    var url = 'http://localhost:8181/context.json?sessionId=' + sessionId;
+    var url = 'http://localhost:8181/cxs/context.json?sessionId=' + sessionId;
     var xhr = new XMLHttpRequest();
     var isGet = data.length < 100;
     if (isGet) {
@@ -194,7 +194,7 @@
 * If we specify a payload, it is expected to use the JSON format so we `stringify` it and encode it if passed as a URL parameter in a `GET` request.
 * We need to make a https://developer.mozilla.org/en-US/docs/Web/HTTP/Access_control_CORS[`CORS`] request since the Unomi server is most likely not running on the same host than the one from which the request originates. The specific details are fairly standard and we will not explain them here.
 * We need to either retrieve (from the initial context we retrieved previously using `cxs.sessionId`) or generate a session identifier for our request since Unomi currently requires one.
-* We're calling the `ContextServlet` using the default install URI, specifying the session identifier: `http://localhost:8181/context.json?sessionId=&#39; + sessionId`. This URI requests context from Unomi, resulting in an updated `cxs` object in the javascript global scope. The context server can reply to this request either by returning a JSON-only object containing solely the context information as is the case when the requested URI is `context.json`. However, if the client requests `context.js` then useful functions to interact with Unomi are added to the `cxs` object in addition to the context information as depicted above.
+* We're calling the `ContextServlet` using the default install URI, specifying the session identifier: `http://localhost:8181/cxs/context.json?sessionId=&#39; + sessionId`. This URI requests context from Unomi, resulting in an updated `cxs` object in the javascript global scope. The context server can reply to this request either by returning a JSON-only object containing solely the context information as is the case when the requested URI is `context.json`. However, if the client requests `context.js` then useful functions to interact with Unomi are added to the `cxs` object in addition to the context information as depicted above.
 * We don't need to provide any authentication at all to interact with this part of Unomi since we only have access to read-only data (as well as providing events as we shall see later on). If we had been using the REST API, we would have needed to provide authentication information as well.
 
 ===== Context request and response structure
@@ -459,4 +459,4 @@
 
 Here is an overview of how Unomi processes incoming requests to the `ContextServlet`.
 
-image::unomi-request.png[Unomi request overview]
\ No newline at end of file
+image::unomi-request.png[Unomi request overview]
diff --git a/manual/src/archives/1.2/asciidoc/building-and-deploying.adoc b/manual/src/archives/1.2/asciidoc/building-and-deploying.adoc
index 64075e9..d157ada 100644
--- a/manual/src/archives/1.2/asciidoc/building-and-deploying.adoc
+++ b/manual/src/archives/1.2/asciidoc/building-and-deploying.adoc
@@ -55,7 +55,7 @@
 Starting with version 1.2, Apache Unomi no longer embeds an ElasticSearch server as this is no longer supported by
 the developers of ElasticSearch. Therefore you will need to install a standalone ElasticSearch using the following steps:
 
-. 
+.
 
 Download an ElasticSearch version. Here's the version you will need depending
 on your version of Apache Unomi.
@@ -63,11 +63,11 @@
 Apache Unomi &lt;= 1.2 : https://www.elastic.co/downloads/past-releases/elasticsearch-5-1-2[https://www.elastic.co/downloads/past-releases/elasticsearch-5-1-2]
 Apache Unomi &gt;= 1.3 : https://www.elastic.co/downloads/past-releases/elasticsearch-5-6-3[https://www.elastic.co/downloads/past-releases/elasticsearch-5-6-3]
 
-. 
+.
 
 Uncompress the downloaded package into a directory
 
-. 
+.
 
 In the config/elasticsearch.yml file, uncomment and modify the following line :
 
@@ -76,7 +76,7 @@
 cluster.name: contextElasticSearch
 ----
 
-. 
+.
 
 Launch the server using
 
@@ -86,11 +86,11 @@
 bin\elasticsearch.bat (Windows)
 ----
 
-. 
+.
 
-Check that the ElasticSearch is up and running by accessing the following URL : 
+Check that the ElasticSearch is up and running by accessing the following URL :
 
-http://localhost:9200[http://localhost:9200] 
+http://localhost:9200[http://localhost:9200]
 
 ==== Deploying the generated binary package
 
@@ -98,14 +98,14 @@
 Simply uncompress the package/target/unomi-VERSION.tar.gz (for Linux or Mac OS X) or
  package/target/unomi-VERSION.zip (for Windows) archive into the directory of your choice.
 
-You can then start the server simply by using the command on UNIX/Linux/MacOS X : 
+You can then start the server simply by using the command on UNIX/Linux/MacOS X :
 
 [source]
 ----
-./bin/karaf    
+./bin/karaf
 ----
 
-or on Windows shell : 
+or on Windows shell :
 
 [source]
 ----
@@ -120,7 +120,7 @@
 Additional requirements:
 * Apache Karaf 3.x, http://karaf.apache.org[http://karaf.apache.org]
 
-. 
+.
 
 Before deploying, make sure that you have Apache Karaf properly installed. You will also have to increase the
 default maximum memory size and perm gen size by adjusting the following environment values in the bin/setenv(.bat)
@@ -134,7 +134,7 @@
    export JAVA_MAX_PERM_MEM=384M
 ----
 
-. 
+.
 
 Install the WAR support, CXF and Karaf Cellar into Karaf by doing the following in the Karaf command line:
 
@@ -146,7 +146,7 @@
    feature:install unomi-kar
 ----
 
-. 
+.
 
 Create a new $MY_KARAF_HOME/etc/org.apache.cxf.osgi.cfg file and put the following property inside :
 
@@ -155,7 +155,7 @@
    org.apache.cxf.servlet.context=/cxs
 ----
 
-. 
+.
 
 If all went smoothly, you should be able to access the context script here : http://localhost:8181/cxs/cluster[http://localhost:8181/cxs/cluster] .
  You should be able to login with karaf / karaf and see basic server information. If not something went wrong during the install.
@@ -163,14 +163,14 @@
 ==== JDK Selection on Mac OS X
 
 You might need to select the JDK to run the tests in the itests subproject. In order to do so you can list the
-installed JDKs with the following command : 
+installed JDKs with the following command :
 
 [source]
 ----
 /usr/libexec/java_home -V
 ----
 
-which will output something like this : 
+which will output something like this :
 
 [source]
 ----
@@ -184,21 +184,21 @@
     1.6.0_65-b14-462, i386: "Java SE 6" /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home
 ----
 
-You can then select the one you want using : 
+You can then select the one you want using :
 
 [source]
 ----
 export JAVA_HOME=`/usr/libexec/java_home -v 1.7.0_51`
 ----
 
-and then check that it was correctly referenced using: 
+and then check that it was correctly referenced using:
 
 [source]
 ----
 java -version
 ----
 
-which should give you a result such as this: 
+which should give you a result such as this:
 
 [source]
 ----
@@ -212,11 +212,11 @@
 The integration tests are not executed by default to make build time minimal, but it is recommended to run the
 integration tests at least once before using the server to make sure that everything is ok in the build. Another way
 to use these tests is to run them from a continuous integration server such as Jenkins, Apache Gump, Atlassian Bamboo or
- others. 
+ others.
 
 Note : the integration tests require a JDK 7 or more recent !
 
-To run the tests simply activate the following profile : 
+To run the tests simply activate the following profile :
 
 [source]
 ----
@@ -250,7 +250,7 @@
    http://localhost:8181/index.html
 ----
 
-This test page will trigger the loading of the /context.js script, which will try to retrieving the user context
+This test page will trigger the loading of the /cxs/context.js script, which will try to retrieving the user context
 or create a new one if it doesn't exist yet. It also contains an experimental integration with Facebook Login, but it
 doesn't yet save the context back to the context server.
 
@@ -265,4 +265,4 @@
     var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0]; g.type='text/javascript'; g.defer=true; g.async=true; g.src=u+'context.js';
     s.parentNode.insertBefore(g,s); })();
 </script>
-----
\ No newline at end of file
+----
diff --git a/manual/src/archives/1.2/asciidoc/configuration.adoc b/manual/src/archives/1.2/asciidoc/configuration.adoc
index 2d915f5..605bb3a 100644
--- a/manual/src/archives/1.2/asciidoc/configuration.adoc
+++ b/manual/src/archives/1.2/asciidoc/configuration.adoc
@@ -31,7 +31,7 @@
 it is recommended to do this BEFORE you start the server for the first time, or you will loose all the data
 you have stored previously.
 
-To change these settings, you will need to modify a file called 
+To change these settings, you will need to modify a file called
 
 [source]
 ----
@@ -70,7 +70,7 @@
 ----
 
 The events set in allowedEvents will be secured and will only be accepted if the call comes from the specified IP
-address, and if the secret-key is passed in the X-Unomi-Peer header. 
+address, and if the secret-key is passed in the X-Unomi-Peer header.
 
 ==== Installing the MaxMind GeoIPLite2 IP lookup database
 
@@ -100,13 +100,13 @@
 
 The generated package is also configured with a default SSL certificate. You can change it by following these steps :
 
-. 
+.
 
 Replace the existing keystore in $MY_KARAF_HOME/etc/keystore by your own certificate :
 
 http://wiki.eclipse.org/Jetty/Howto/Configure_SSL[http://wiki.eclipse.org/Jetty/Howto/Configure_SSL]
 
-. 
+.
 
 Update the keystore and certificate password in $MY_KARAF_HOME/etc/custom.properties file :
 
@@ -121,13 +121,13 @@
 
 You should now have SSL setup on Karaf with your certificate, and you can test it by trying to access it on port 9443.
 
-. 
+.
 
 Changing the default Karaf password can be done by modifying the etc/users.properties file
 
-. 
+.
 
-You will also need to change the user/password information in the org.apache.unomi.cluster.cfg file : 
+You will also need to change the user/password information in the org.apache.unomi.cluster.cfg file :
 
 [source]
 ----
@@ -155,24 +155,24 @@
 ==== Securing a production environment
 
 Before going live with a project, you should _absolutely_ read the following section that will help you setup a proper
-secure environment for running your context server. 
+secure environment for running your context server.
 
-Step 1: Install and configure a firewall 
+Step 1: Install and configure a firewall
 
 You should setup a firewall around your cluster of context servers and/or Elasticsearch nodes. If you have an
-application-level firewall you should only allow the following connections open to the whole world : 
+application-level firewall you should only allow the following connections open to the whole world :
 
-* http://localhost:8181/context.js[http://localhost:8181/context.js]
-* http://localhost:8181/eventcollector[http://localhost:8181/eventcollector]
+* http://localhost:8181/cxs/context.js[http://localhost:8181/cxs/context.js]
+* http://localhost:8181/cxs/eventcollector[http://localhost:8181/cxs/eventcollector]
 
 All other ports should not be accessible to the world.
 
 For your Context Server client applications (such as the Jahia CMS), you will need to make the following ports
-accessible : 
+accessible :
 
 [source]
 ----
-8181 (Context Server HTTP port) 
+8181 (Context Server HTTP port)
 9443 (Context Server HTTPS port)
 ----
 
@@ -180,11 +180,11 @@
 highly recommended that you design your client applications to use the HTTPS port for accessing the REST API.
 
 The user accounts to access the REST API are actually routed through Karaf's JAAS support, which you may find the
-documentation for here : 
+documentation for here :
 
 * http://karaf.apache.org/manual/latest/users-guide/security.html[http://karaf.apache.org/manual/latest/users-guide/security.html]
 
-The default username/password is 
+The default username/password is
 
 [source]
 ----
@@ -192,7 +192,7 @@
 ----
 
 You should really change this default username/password as soon as possible. To do so, simply modify the following
-file : 
+file :
 
 [source]
 ----
@@ -206,7 +206,7 @@
 
 Step 2 : Follow industry recommended best practices for securing Elasticsearch
 
-You may find more valuable recommendations here : 
+You may find more valuable recommendations here :
 
 * https://www.elastic.co/blog/found-elasticsearch-security[https://www.elastic.co/blog/found-elasticsearch-security]
 * https://www.elastic.co/blog/scripting-security[https://www.elastic.co/blog/scripting-security]
@@ -308,7 +308,7 @@
 ==== Changing the default tracking location
 
 When performing localhost requests to Apache Unomi, a default location will be used to insert values into the session
-to make the location-based personalization still work. You can find the default location settings in the file : 
+to make the location-based personalization still work. You can find the default location settings in the file :
 
 [source]
 ----
@@ -342,4 +342,4 @@
 ssh -p 8102 karaf@localhost
 ----
 
-or the user/password you have setup to protect the system if you have changed it.
\ No newline at end of file
+or the user/password you have setup to protect the system if you have changed it.
diff --git a/manual/src/archives/1.2/asciidoc/getting-started.adoc b/manual/src/archives/1.2/asciidoc/getting-started.adoc
index fbbdc04..4a6646f 100644
--- a/manual/src/archives/1.2/asciidoc/getting-started.adoc
+++ b/manual/src/archives/1.2/asciidoc/getting-started.adoc
@@ -45,17 +45,17 @@
 ----
 
 This indicates that all the Unomi services are started and ready to react to requests. You can then open a browser and go to `http://localhost:8181/cxs` to see the list of
-available RESTful services or retrieve an initial context at `http://localhost:8181/context.json` (which isn't very useful at this point).
+available RESTful services or retrieve an initial context at `http://localhost:8181/cxs/context.json` (which isn't very useful at this point).
 
 ===== Request examples
 
 ====== Retrieving your first context
 
-You can retrieve a context using curl like this : 
+You can retrieve a context using curl like this :
 
 [source]
 ----
-curl http://localhost:8181/context.js?sessionId=1234
+curl http://localhost:8181/cxs/context.js?sessionId=1234
 ----
 
 This will retrieve a JavaScript script that contains a `cxs` object that contains the context with the current user
@@ -68,7 +68,7 @@
 
 [source]
 ----
-curl http://localhost:8181/context.json?sessionId=1234
+curl http://localhost:8181/cxs/context.json?sessionId=1234
 ----
 
 ====== Accessing profile properties in a context
@@ -81,13 +81,13 @@
 
 [source]
 ----
-curl -H "Content-Type: application/json" -X POST -d '{"source":{"itemId":"homepage","itemType":"page","scope":"example"},"requiredProfileProperties":["*"],"requiredSessionProperties":["*"],"requireSegments":true}' http://localhost:8181/context.json?sessionId=1234
+curl -H "Content-Type: application/json" -X POST -d '{"source":{"itemId":"homepage","itemType":"page","scope":"example"},"requiredProfileProperties":["*"],"requiredSessionProperties":["*"],"requireSegments":true}' http://localhost:8181/cxs/context.json?sessionId=1234
 ----
 
 The `requiredProfileProperties` and `requiredSessionProperties` are properties that take an array of property names
 that should be retrieved. In this case we use the wildcard character '*' to say we want to retrieve all the available
 properties. The structure of the JSON object that you should send is a JSON-serialized version of the http://unomi.incubator.apache.org/unomi-api/apidocs/org/apache/unomi/api/ContextRequest.html[ContextRequest]
-Java class. 
+Java class.
 
 ====== Sending events using the context servlet
 
@@ -96,13 +96,13 @@
 
 [source]
 ----
-curl -H "Content-Type: application/json" -X POST -d '{"source":{"itemId":"homepage","itemType":"page","scope":"example"},"events":[{"eventType":"view","scope": "example","source":{"itemType": "site","scope":"example","itemId": "mysite"},"target":{"itemType":"page","scope":"example","itemId":"homepage","properties":{"pageInfo":{"referringURL":""}}}}]}' http://localhost:8181/context.json?sessionId=1234
+curl -H "Content-Type: application/json" -X POST -d '{"source":{"itemId":"homepage","itemType":"page","scope":"example"},"events":[{"eventType":"view","scope": "example","source":{"itemType": "site","scope":"example","itemId": "mysite"},"target":{"itemType":"page","scope":"example","itemId":"homepage","properties":{"pageInfo":{"referringURL":""}}}}]}' http://localhost:8181/cxs/context.json?sessionId=1234
 ----
 
 Upon received events, Apache Unomi will execute all the rules that match the current context, and return an updated context.
 This way of sending events is usually used upon first loading of a page. If you want to send events after the page has
 finished loading you could either do a second call and get an updating context, or if you don't need the context and want
-to send events in a network optimal way you can use the eventcollector servlet (see below). 
+to send events in a network optimal way you can use the eventcollector servlet (see below).
 
 ====== Sending events using the eventcollector servlet
 
@@ -111,12 +111,12 @@
 
 [source]
 ----
-curl -H "Content-Type: application/json" -X POST -d '{"events":[{"eventType":"view","scope": "example","source":{"itemType": "site","scope":"example","itemId": "mysite"},"target":{"itemType":"page","scope":"example","itemId":"homepage","properties":{"pageInfo":{"referringURL":""}}}}]}' http://localhost:8181/eventcollector?sessionId=1234
+curl -H "Content-Type: application/json" -X POST -d '{"events":[{"eventType":"view","scope": "example","source":{"itemType": "site","scope":"example","itemId": "mysite"},"target":{"itemType":"page","scope":"example","itemId":"homepage","properties":{"pageInfo":{"referringURL":""}}}}]}' http://localhost:8181/cxs/eventcollector?sessionId=1234
 ----
 
 Note that the eventcollector executes the rules but does not return a context. If is generally used after a page is loaded
-to send additional events. 
+to send additional events.
 
 ===== Where to go from here
 
-* Read the link:twitter-sample.html[Twitter sample] documentation that contains a detailed example of how to integrate with Apache Unomi.
\ No newline at end of file
+* Read the link:twitter-sample.html[Twitter sample] documentation that contains a detailed example of how to integrate with Apache Unomi.
diff --git a/manual/src/archives/1.2/asciidoc/samples/twitter-sample.adoc b/manual/src/archives/1.2/asciidoc/samples/twitter-sample.adoc
index dc37f41..12b9805 100644
--- a/manual/src/archives/1.2/asciidoc/samples/twitter-sample.adoc
+++ b/manual/src/archives/1.2/asciidoc/samples/twitter-sample.adoc
@@ -64,7 +64,7 @@
 
 ==== Retrieving context information from Unomi using the context servlet
 
-Unomi provides two ways to retrieve context: either as a pure JSON object containing strictly context information or as a couple of JSON objects augmented with javascript functions that can be used to interact with the Unomi server using the `&lt;context server base URL&gt;/context.json` or `&lt;context server base URL&gt;/context.js` URLs, respectively.
+Unomi provides two ways to retrieve context: either as a pure JSON object containing strictly context information or as a couple of JSON objects augmented with javascript functions that can be used to interact with the Unomi server using the `&lt;context server base URL&gt;/cxs/context.json` or `&lt;context server base URL&gt;/context.js` URLs, respectively.
 
 Below is an example of asynchronously loading the initial context using the javascript version, assuming a default Unomi install running on `http://localhost:8181`:
 
@@ -76,7 +76,7 @@
     if (document.getElementById(id)) return;
     js = document.createElement(elementToCreate);
     js.id = id;
-    js.src = 'http://localhost:8181/context.js';
+    js.src = 'http://localhost:8181/cxs/context.js';
     fjs.parentNode.insertBefore(js, fjs);
 }(document, 'script', 'context'));
 
@@ -122,7 +122,7 @@
     var data = JSON.stringify(payload);
     // if we don't already have a session id, generate one
     var sessionId = cxs.sessionId || generateUUID();
-    var url = 'http://localhost:8181/context.json?sessionId=' + sessionId;
+    var url = 'http://localhost:8181/cxs/context.json?sessionId=' + sessionId;
     var xhr = new XMLHttpRequest();
     var isGet = data.length < 100;
     if (isGet) {
@@ -166,7 +166,7 @@
 * If we specify a payload, it is expected to use the JSON format so we `stringify` it and encode it if passed as a URL parameter in a `GET` request.
 * We need to make a https://developer.mozilla.org/en-US/docs/Web/HTTP/Access_control_CORS[`CORS`] request since the Unomi server is most likely not running on the same host than the one from which the request originates. The specific details are fairly standard and we will not explain them here.
 * We need to either retrieve (from the initial context we retrieved previously using `cxs.sessionId`) or generate a session identifier for our request since Unomi currently requires one.
-* We're calling the `ContextServlet` using the default install URI, specifying the session identifier: `http://localhost:8181/context.json?sessionId=&#39; + sessionId`. This URI requests context from Unomi, resulting in an updated `cxs` object in the javascript global scope. The context server can reply to this request either by returning a JSON-only object containing solely the context information as is the case when the requested URI is `context.json`. However, if the client requests `context.js` then useful functions to interact with Unomi are added to the `cxs` object in addition to the context information as depicted above.
+* We're calling the `ContextServlet` using the default install URI, specifying the session identifier: `http://localhost:8181/cxs/context.json?sessionId=&#39; + sessionId`. This URI requests context from Unomi, resulting in an updated `cxs` object in the javascript global scope. The context server can reply to this request either by returning a JSON-only object containing solely the context information as is the case when the requested URI is `context.json`. However, if the client requests `context.js` then useful functions to interact with Unomi are added to the `cxs` object in addition to the context information as depicted above.
 * We don't need to provide any authentication at all to interact with this part of Unomi since we only have access to read-only data (as well as providing events as we shall see later on). If we had been using the REST API, we would have needed to provide authentication information as well.
 
 ===== Context request and response structure
@@ -431,4 +431,4 @@
 
 Here is an overview of how Unomi processes incoming requests to the `ContextServlet`.
 
-image::unomi-request.png[Unomi request overview]
\ No newline at end of file
+image::unomi-request.png[Unomi request overview]
diff --git a/manual/src/archives/1.3/asciidoc/5-min-quickstart.adoc b/manual/src/archives/1.3/asciidoc/5-min-quickstart.adoc
index 5bb2e20..5c00240 100644
--- a/manual/src/archives/1.3/asciidoc/5-min-quickstart.adoc
+++ b/manual/src/archives/1.3/asciidoc/5-min-quickstart.adoc
@@ -32,7 +32,7 @@
 
 9) Try accessing https://localhost:9443/cxs/cluster with username/password: `karaf/karaf` . You might get a certificate warning in your browser, just accept it despite the warning it is safe.
 
-10) Request your first context by simply accessing : http://localhost:8181/context.js?sessionId=1234
+10) Request your first context by simply accessing : http://localhost:8181/cxs/context.js?sessionId=1234
 
 11) If something goes wrong, you should check the logs in `./data/log/karaf.log`. If you get errors on ElasticSearch,
 make sure you are using the proper version.
diff --git a/manual/src/archives/1.3/asciidoc/building-and-deploying.adoc b/manual/src/archives/1.3/asciidoc/building-and-deploying.adoc
index 558ddd2..f5d78b8 100644
--- a/manual/src/archives/1.3/asciidoc/building-and-deploying.adoc
+++ b/manual/src/archives/1.3/asciidoc/building-and-deploying.adoc
@@ -79,9 +79,9 @@
 bin\elasticsearch.bat (Windows)
 ----
 
-Check that the ElasticSearch is up and running by accessing the following URL : 
+Check that the ElasticSearch is up and running by accessing the following URL :
 
-http://localhost:9200[http://localhost:9200] 
+http://localhost:9200[http://localhost:9200]
 
 ==== Deploying the generated binary package
 
@@ -89,14 +89,14 @@
 Simply uncompress the package/target/unomi-VERSION.tar.gz (for Linux or Mac OS X) or
  package/target/unomi-VERSION.zip (for Windows) archive into the directory of your choice.
 
-You can then start the server simply by using the command on UNIX/Linux/MacOS X : 
+You can then start the server simply by using the command on UNIX/Linux/MacOS X :
 
 [source]
 ----
-./bin/karaf    
+./bin/karaf
 ----
 
-or on Windows shell : 
+or on Windows shell :
 
 [source]
 ----
@@ -108,7 +108,7 @@
 
 [source]
 ----
-unomi:start        
+unomi:start
 ----
 
 ==== Deploying into an existing Karaf server
@@ -154,14 +154,14 @@
 ==== JDK Selection on Mac OS X
 
 You might need to select the JDK to run the tests in the itests subproject. In order to do so you can list the
-installed JDKs with the following command : 
+installed JDKs with the following command :
 
 [source]
 ----
 /usr/libexec/java_home -V
 ----
 
-which will output something like this : 
+which will output something like this :
 
 [source]
 ----
@@ -175,21 +175,21 @@
     1.6.0_65-b14-462, i386: "Java SE 6" /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home
 ----
 
-You can then select the one you want using : 
+You can then select the one you want using :
 
 [source]
 ----
 export JAVA_HOME=`/usr/libexec/java_home -v 1.7.0_51`
 ----
 
-and then check that it was correctly referenced using: 
+and then check that it was correctly referenced using:
 
 [source]
 ----
 java -version
 ----
 
-which should give you a result such as this: 
+which should give you a result such as this:
 
 [source]
 ----
@@ -203,11 +203,11 @@
 The integration tests are not executed by default to make build time minimal, but it is recommended to run the
 integration tests at least once before using the server to make sure that everything is ok in the build. Another way
 to use these tests is to run them from a continuous integration server such as Jenkins, Apache Gump, Atlassian Bamboo or
- others. 
+ others.
 
 Note : the integration tests require a JDK 7 or more recent !
 
-To run the tests simply activate the following profile : 
+To run the tests simply activate the following profile :
 
 [source]
 ----
@@ -241,7 +241,7 @@
    http://localhost:8181/index.html
 ----
 
-This test page will trigger the loading of the /context.js script, which will try to retrieving the user context
+This test page will trigger the loading of the /cxs/context.js script, which will try to retrieving the user context
 or create a new one if it doesn't exist yet. It also contains an experimental integration with Facebook Login, but it
 doesn't yet save the context back to the context server.
 
@@ -256,4 +256,4 @@
     var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0]; g.type='text/javascript'; g.defer=true; g.async=true; g.src=u+'context.js';
     s.parentNode.insertBefore(g,s); })();
 </script>
-----
\ No newline at end of file
+----
diff --git a/manual/src/archives/1.3/asciidoc/configuration.adoc b/manual/src/archives/1.3/asciidoc/configuration.adoc
index 2c57e83..dde6b23 100644
--- a/manual/src/archives/1.3/asciidoc/configuration.adoc
+++ b/manual/src/archives/1.3/asciidoc/configuration.adoc
@@ -40,7 +40,7 @@
 it is recommended to do this BEFORE you start the server for the first time, or you will loose all the data
 you have stored previously.
 
-To change these settings, you will need to modify a file called 
+To change these settings, you will need to modify a file called
 
 [source]
 ----
@@ -80,7 +80,7 @@
 ----
 
 The events set in allowedEvents will be secured and will only be accepted if the call comes from the specified IP
-address, and if the secret-key is passed in the X-Unomi-Peer header. 
+address, and if the secret-key is passed in the X-Unomi-Peer header.
 
 ==== Installing the MaxMind GeoIPLite2 IP lookup database
 
@@ -147,24 +147,24 @@
 ==== Securing a production environment
 
 Before going live with a project, you should _absolutely_ read the following section that will help you setup a proper
-secure environment for running your context server. 
+secure environment for running your context server.
 
-Step 1: Install and configure a firewall 
+Step 1: Install and configure a firewall
 
 You should setup a firewall around your cluster of context servers and/or Elasticsearch nodes. If you have an
-application-level firewall you should only allow the following connections open to the whole world : 
+application-level firewall you should only allow the following connections open to the whole world :
 
-* http://localhost:8181/context.js[http://localhost:8181/context.js]
-* http://localhost:8181/eventcollector[http://localhost:8181/eventcollector]
+* http://localhost:8181/cxs/context.js[http://localhost:8181/cxs/context.js]
+* http://localhost:8181/cxs/eventcollector[http://localhost:8181/cxs/eventcollector]
 
 All other ports should not be accessible to the world.
 
 For your Context Server client applications (such as the Jahia CMS), you will need to make the following ports
-accessible : 
+accessible :
 
 [source]
 ----
-8181 (Context Server HTTP port) 
+8181 (Context Server HTTP port)
 9443 (Context Server HTTPS port)
 ----
 
@@ -172,11 +172,11 @@
 highly recommended that you design your client applications to use the HTTPS port for accessing the REST API.
 
 The user accounts to access the REST API are actually routed through Karaf's JAAS support, which you may find the
-documentation for here : 
+documentation for here :
 
 * http://karaf.apache.org/manual/latest/users-guide/security.html[http://karaf.apache.org/manual/latest/users-guide/security.html]
 
-The default username/password is 
+The default username/password is
 
 [source]
 ----
@@ -184,7 +184,7 @@
 ----
 
 You should really change this default username/password as soon as possible. To do so, simply modify the following
-file : 
+file :
 
 [source]
 ----
@@ -198,7 +198,7 @@
 
 Step 2 : Follow industry recommended best practices for securing Elasticsearch
 
-You may find more valuable recommendations here : 
+You may find more valuable recommendations here :
 
 * https://www.elastic.co/blog/found-elasticsearch-security[https://www.elastic.co/blog/found-elasticsearch-security]
 * https://www.elastic.co/blog/scripting-security[https://www.elastic.co/blog/scripting-security]
@@ -300,7 +300,7 @@
 ==== Changing the default tracking location
 
 When performing localhost requests to Apache Unomi, a default location will be used to insert values into the session
-to make the location-based personalization still work. You can find the default location settings in the file : 
+to make the location-based personalization still work. You can find the default location settings in the file :
 
 [source]
 ----
@@ -354,7 +354,7 @@
 . Download http://central.maven.org/maven2/org/bouncycastle/bcpkix-jdk15on/1.55/bcpkix-jdk15on-1.55.jar[http://central.maven.org/maven2/org/bouncycastle/bcpkix-jdk15on/1.55/bcpkix-jdk15on-1.55.jar] to XPACK_JARS_DIRECTORY
 . Download http://central.maven.org/maven2/org/bouncycastle/bcprov-jdk15on/1.55/bcprov-jdk15on-1.55.jar[http://central.maven.org/maven2/org/bouncycastle/bcprov-jdk15on/1.55/bcprov-jdk15on-1.55.jar] to XPACK_JARS_DIRECTORY
 . Download http://central.maven.org/maven2/com/sun/mail/javax.mail/1.5.3/javax.mail-1.5.3.jar[http://central.maven.org/maven2/com/sun/mail/javax.mail/1.5.3/javax.mail-1.5.3.jar] to XPACK_JARS_DIRECTORY
-. 
+.
 
 Edit etc/org.apache.unomi.persistence.elasticsearch.cfg to add the following settings:
 
@@ -373,7 +373,7 @@
 transportClientProperties=xpack.security.user=elastic:changeme,xpack.ssl.key=/home/user/elasticsearch-5.6.3/config/x-pack/localhost/localhost.key,xpack.ssl.certificate=/home/user/elasticsearch-5.6.3/config/x-pack/localhost/localhost.crt,xpack.ssl.certificate_authorities=/home/user/elasticsearch-5.6.3/config/x-pack/ca/ca.crt,xpack.security.transport.ssl.enabled=true
 ----
 
-. 
+.
 
 Launch Karaf and launch unomi using the command from the shell :
 
@@ -400,4 +400,4 @@
 [source]
 ----
 config:property-set transportClientProperties xpack.security.user=elastic:changeme,xpack.ssl.key=/home/user/elasticsearch-5.6.3/config/x-pack/localhost/localhost.key,xpack.ssl.certificate=/home/user/elasticsearch-5.6.3/config/x-pack/localhost/localhost.crt,xpack.ssl.certificate_authorities=/home/user/elasticsearch-5.6.3/config/x-pack/ca/ca.crt,xpack.security.transport.ssl.enabled=true
-----
\ No newline at end of file
+----
diff --git a/manual/src/archives/1.3/asciidoc/consent-api.adoc b/manual/src/archives/1.3/asciidoc/consent-api.adoc
index fad664f..9a20a60 100644
--- a/manual/src/archives/1.3/asciidoc/consent-api.adoc
+++ b/manual/src/archives/1.3/asciidoc/consent-api.adoc
@@ -52,7 +52,7 @@
 ==== Consent type definitions
 
 Apache Unomi does not manage consent definitions, it leaves that to an external system (for example a CMS) so that it
-can handle user-facing UIs to create, update, internationalize and present consent definitions to end users. 
+can handle user-facing UIs to create, update, internationalize and present consent definitions to end users.
 
 The only thing that is import to Apache Unomi to manage visitor consents is a globally unique key, that is called the
 consent type.
@@ -99,7 +99,7 @@
 
 [source]
 ----
-curl -H "Content-Type: application/json" -X POST -d '{"source":{"itemId":"homepage","itemType":"page","scope":"example"},"events":[{"scope":"example","eventType":"modifyConsent","source":{"itemType":"page","scope":"example","itemId":"anItemId"},"target":{"itemType":"anyType","scope":"example","itemId":"anyItemId"},"properties":{"consent":{"typeIdentifier":"newsletter","scope":"example","status":"GRANTED","statusDate":"2018-05-22T09:27:09.473Z","revokeDate":"2020-05-21T09:27:09.473Z"}}}]}' http://localhost:8181/context.json?sessionId=1234
+curl -H "Content-Type: application/json" -X POST -d '{"source":{"itemId":"homepage","itemType":"page","scope":"example"},"events":[{"scope":"example","eventType":"modifyConsent","source":{"itemType":"page","scope":"example","itemId":"anItemId"},"target":{"itemType":"anyType","scope":"example","itemId":"anyItemId"},"properties":{"consent":{"typeIdentifier":"newsletter","scope":"example","status":"GRANTED","statusDate":"2018-05-22T09:27:09.473Z","revokeDate":"2020-05-21T09:27:09.473Z"}}}]}' http://localhost:8181/cxs/context.json?sessionId=1234
 ----
 
 ==== How it works (internally)
@@ -136,4 +136,4 @@
 As we can see this rule is pretty simple it will simply execute the modifyConsentAction that is implemented by the
 https://github.com/apache/incubator-unomi/blob/9f1bab437fd93826dc54d318ed00d3b2e3161437/plugins/baseplugin/src/main/java/org/apache/unomi/plugins/baseplugin/actions/ModifyConsentAction.java[ModifyConsentAction Java class]
 
-This class will update the current visitor profile to add/update/revoke any consents that are included in the event.
\ No newline at end of file
+This class will update the current visitor profile to add/update/revoke any consents that are included in the event.
diff --git a/manual/src/archives/1.3/asciidoc/getting-started.adoc b/manual/src/archives/1.3/asciidoc/getting-started.adoc
index bca312a..10ec034 100644
--- a/manual/src/archives/1.3/asciidoc/getting-started.adoc
+++ b/manual/src/archives/1.3/asciidoc/getting-started.adoc
@@ -39,17 +39,17 @@
 ----
 
 This indicates that all the Unomi services are started and ready to react to requests. You can then open a browser and go to `http://localhost:8181/cxs` to see the list of
-available RESTful services or retrieve an initial context at `http://localhost:8181/context.json` (which isn't very useful at this point).
+available RESTful services or retrieve an initial context at `http://localhost:8181/cxs/context.json` (which isn't very useful at this point).
 
 ===== Request examples
 
 ====== Retrieving your first context
 
-You can retrieve a context using curl like this : 
+You can retrieve a context using curl like this :
 
 [source]
 ----
-curl http://localhost:8181/context.js?sessionId=1234
+curl http://localhost:8181/cxs/context.js?sessionId=1234
 ----
 
 This will retrieve a JavaScript script that contains a `cxs` object that contains the context with the current user
@@ -62,7 +62,7 @@
 
 [source]
 ----
-curl http://localhost:8181/context.json?sessionId=1234
+curl http://localhost:8181/cxs/context.json?sessionId=1234
 ----
 
 ====== Accessing profile properties in a context
@@ -75,13 +75,13 @@
 
 [source]
 ----
-curl -H "Content-Type: application/json" -X POST -d '{"source":{"itemId":"homepage","itemType":"page","scope":"example"},"requiredProfileProperties":["*"],"requiredSessionProperties":["*"],"requireSegments":true}' http://localhost:8181/context.json?sessionId=1234
+curl -H "Content-Type: application/json" -X POST -d '{"source":{"itemId":"homepage","itemType":"page","scope":"example"},"requiredProfileProperties":["*"],"requiredSessionProperties":["*"],"requireSegments":true}' http://localhost:8181/cxs/context.json?sessionId=1234
 ----
 
 The `requiredProfileProperties` and `requiredSessionProperties` are properties that take an array of property names
 that should be retrieved. In this case we use the wildcard character '*' to say we want to retrieve all the available
 properties. The structure of the JSON object that you should send is a JSON-serialized version of the http://unomi.incubator.apache.org/unomi-api/apidocs/org/apache/unomi/api/ContextRequest.html[ContextRequest]
-Java class. 
+Java class.
 
 ====== Sending events using the context servlet
 
@@ -90,13 +90,13 @@
 
 [source]
 ----
-curl -H "Content-Type: application/json" -X POST -d '{"source":{"itemId":"homepage","itemType":"page","scope":"example"},"events":[{"eventType":"view","scope": "example","source":{"itemType": "site","scope":"example","itemId": "mysite"},"target":{"itemType":"page","scope":"example","itemId":"homepage","properties":{"pageInfo":{"referringURL":""}}}}]}' http://localhost:8181/context.json?sessionId=1234
+curl -H "Content-Type: application/json" -X POST -d '{"source":{"itemId":"homepage","itemType":"page","scope":"example"},"events":[{"eventType":"view","scope": "example","source":{"itemType": "site","scope":"example","itemId": "mysite"},"target":{"itemType":"page","scope":"example","itemId":"homepage","properties":{"pageInfo":{"referringURL":""}}}}]}' http://localhost:8181/cxs/context.json?sessionId=1234
 ----
 
 Upon received events, Apache Unomi will execute all the rules that match the current context, and return an updated context.
 This way of sending events is usually used upon first loading of a page. If you want to send events after the page has
 finished loading you could either do a second call and get an updating context, or if you don't need the context and want
-to send events in a network optimal way you can use the eventcollector servlet (see below). 
+to send events in a network optimal way you can use the eventcollector servlet (see below).
 
 ====== Sending events using the eventcollector servlet
 
@@ -105,12 +105,12 @@
 
 [source]
 ----
-curl -H "Content-Type: application/json" -X POST -d '{"events":[{"eventType":"view","scope": "example","source":{"itemType": "site","scope":"example","itemId": "mysite"},"target":{"itemType":"page","scope":"example","itemId":"homepage","properties":{"pageInfo":{"referringURL":""}}}}]}' http://localhost:8181/eventcollector?sessionId=1234
+curl -H "Content-Type: application/json" -X POST -d '{"events":[{"eventType":"view","scope": "example","source":{"itemType": "site","scope":"example","itemId": "mysite"},"target":{"itemType":"page","scope":"example","itemId":"homepage","properties":{"pageInfo":{"referringURL":""}}}}]}' http://localhost:8181/cxs/eventcollector?sessionId=1234
 ----
 
 Note that the eventcollector executes the rules but does not return a context. If is generally used after a page is loaded
-to send additional events. 
+to send additional events.
 
 ===== Where to go from here
 
-* Read the <<_twitter_sample,Twitter sample>> documentation that contains a detailed example of how to integrate with Apache Unomi.
\ No newline at end of file
+* Read the <<_twitter_sample,Twitter sample>> documentation that contains a detailed example of how to integrate with Apache Unomi.
diff --git a/manual/src/archives/1.3/asciidoc/samples/twitter-sample.adoc b/manual/src/archives/1.3/asciidoc/samples/twitter-sample.adoc
index e33c5bb..8462397 100644
--- a/manual/src/archives/1.3/asciidoc/samples/twitter-sample.adoc
+++ b/manual/src/archives/1.3/asciidoc/samples/twitter-sample.adoc
@@ -63,7 +63,7 @@
 
 ==== Retrieving context information from Unomi using the context servlet
 
-Unomi provides two ways to retrieve context: either as a pure JSON object containing strictly context information or as a couple of JSON objects augmented with javascript functions that can be used to interact with the Unomi server using the `&lt;context server base URL&gt;/context.json` or `&lt;context server base URL&gt;/context.js` URLs, respectively.
+Unomi provides two ways to retrieve context: either as a pure JSON object containing strictly context information or as a couple of JSON objects augmented with javascript functions that can be used to interact with the Unomi server using the `&lt;context server base URL&gt;/cxs/context.json` or `&lt;context server base URL&gt;/context.js` URLs, respectively.
 
 Below is an example of asynchronously loading the initial context using the javascript version, assuming a default Unomi install running on `http://localhost:8181`:
 
@@ -75,7 +75,7 @@
     if (document.getElementById(id)) return;
     js = document.createElement(elementToCreate);
     js.id = id;
-    js.src = 'http://localhost:8181/context.js';
+    js.src = 'http://localhost:8181/cxs/context.js';
     fjs.parentNode.insertBefore(js, fjs);
 }(document, 'script', 'context'));
 
@@ -121,7 +121,7 @@
     var data = JSON.stringify(payload);
     // if we don't already have a session id, generate one
     var sessionId = cxs.sessionId || generateUUID();
-    var url = 'http://localhost:8181/context.json?sessionId=' + sessionId;
+    var url = 'http://localhost:8181/cxs/context.json?sessionId=' + sessionId;
     var xhr = new XMLHttpRequest();
     var isGet = data.length < 100;
     if (isGet) {
@@ -165,7 +165,7 @@
 * If we specify a payload, it is expected to use the JSON format so we `stringify` it and encode it if passed as a URL parameter in a `GET` request.
 * We need to make a https://developer.mozilla.org/en-US/docs/Web/HTTP/Access_control_CORS[`CORS`] request since the Unomi server is most likely not running on the same host than the one from which the request originates. The specific details are fairly standard and we will not explain them here.
 * We need to either retrieve (from the initial context we retrieved previously using `cxs.sessionId`) or generate a session identifier for our request since Unomi currently requires one.
-* We're calling the `ContextServlet` using the default install URI, specifying the session identifier: `http://localhost:8181/context.json?sessionId=&#39; + sessionId`. This URI requests context from Unomi, resulting in an updated `cxs` object in the javascript global scope. The context server can reply to this request either by returning a JSON-only object containing solely the context information as is the case when the requested URI is `context.json`. However, if the client requests `context.js` then useful functions to interact with Unomi are added to the `cxs` object in addition to the context information as depicted above.
+* We're calling the `ContextServlet` using the default install URI, specifying the session identifier: `http://localhost:8181/cxs/context.json?sessionId=&#39; + sessionId`. This URI requests context from Unomi, resulting in an updated `cxs` object in the javascript global scope. The context server can reply to this request either by returning a JSON-only object containing solely the context information as is the case when the requested URI is `context.json`. However, if the client requests `context.js` then useful functions to interact with Unomi are added to the `cxs` object in addition to the context information as depicted above.
 * We don't need to provide any authentication at all to interact with this part of Unomi since we only have access to read-only data (as well as providing events as we shall see later on). If we had been using the REST API, we would have needed to provide authentication information as well.
 
 ===== Context request and response structure
diff --git a/manual/src/archives/1.4/asciidoc/5-min-quickstart.adoc b/manual/src/archives/1.4/asciidoc/5-min-quickstart.adoc
index 0e5fc4e..fbd7f44 100644
--- a/manual/src/archives/1.4/asciidoc/5-min-quickstart.adoc
+++ b/manual/src/archives/1.4/asciidoc/5-min-quickstart.adoc
@@ -32,7 +32,7 @@
 
 9) Try accessing https://localhost:9443/cxs/cluster with username/password: `karaf/karaf` . You might get a certificate warning in your browser, just accept it despite the warning it is safe.
 
-10) Request your first context by simply accessing : http://localhost:8181/context.js?sessionId=1234
+10) Request your first context by simply accessing : http://localhost:8181/cxs/context.js?sessionId=1234
 
 11) If something goes wrong, you should check the logs in `./data/log/karaf.log`. If you get errors on ElasticSearch,
 make sure you are using the proper version.
diff --git a/manual/src/archives/1.4/asciidoc/building-and-deploying.adoc b/manual/src/archives/1.4/asciidoc/building-and-deploying.adoc
index cf34343..c832277 100644
--- a/manual/src/archives/1.4/asciidoc/building-and-deploying.adoc
+++ b/manual/src/archives/1.4/asciidoc/building-and-deploying.adoc
@@ -81,7 +81,7 @@
 
 Check that the ElasticSearch is up and running by accessing the following URL :
 
-http://localhost:9200[http://localhost:9200] 
+http://localhost:9200[http://localhost:9200]
 
 ==== Deploying the generated binary package
 
@@ -89,14 +89,14 @@
 Simply uncompress the package/target/unomi-VERSION.tar.gz (for Linux or Mac OS X) or
  package/target/unomi-VERSION.zip (for Windows) archive into the directory of your choice.
 
-You can then start the server simply by using the command on UNIX/Linux/MacOS X : 
+You can then start the server simply by using the command on UNIX/Linux/MacOS X :
 
 [source]
 ----
-./bin/karaf    
+./bin/karaf
 ----
 
-or on Windows shell : 
+or on Windows shell :
 
 [source]
 ----
@@ -108,7 +108,7 @@
 
 [source]
 ----
-unomi:start        
+unomi:start
 ----
 
 ==== Deploying into an existing Karaf server
@@ -154,14 +154,14 @@
 ==== JDK Selection on Mac OS X
 
 You might need to select the JDK to run the tests in the itests subproject. In order to do so you can list the
-installed JDKs with the following command : 
+installed JDKs with the following command :
 
 [source]
 ----
 /usr/libexec/java_home -V
 ----
 
-which will output something like this : 
+which will output something like this :
 
 [source]
 ----
@@ -175,21 +175,21 @@
     1.6.0_65-b14-462, i386: "Java SE 6" /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home
 ----
 
-You can then select the one you want using : 
+You can then select the one you want using :
 
 [source]
 ----
 export JAVA_HOME=`/usr/libexec/java_home -v 1.7.0_51`
 ----
 
-and then check that it was correctly referenced using: 
+and then check that it was correctly referenced using:
 
 [source]
 ----
 java -version
 ----
 
-which should give you a result such as this: 
+which should give you a result such as this:
 
 [source]
 ----
@@ -203,11 +203,11 @@
 The integration tests are not executed by default to make build time minimal, but it is recommended to run the
 integration tests at least once before using the server to make sure that everything is ok in the build. Another way
 to use these tests is to run them from a continuous integration server such as Jenkins, Apache Gump, Atlassian Bamboo or
- others. 
+ others.
 
 Note : the integration tests require a JDK 7 or more recent !
 
-To run the tests simply activate the following profile : 
+To run the tests simply activate the following profile :
 
 [source]
 ----
@@ -241,6 +241,6 @@
    http://localhost:8181/index.html
 ----
 
-This test page will trigger the loading of the /context.js script, which will try to retrieving the user context
+This test page will trigger the loading of the /cxs/context.js script, which will try to retrieving the user context
 or create a new one if it doesn't exist yet. It also contains an experimental integration with Facebook Login, but it
 doesn't yet save the context back to the context server.
diff --git a/manual/src/archives/1.4/asciidoc/configuration.adoc b/manual/src/archives/1.4/asciidoc/configuration.adoc
index f193b20..a4f712d 100644
--- a/manual/src/archives/1.4/asciidoc/configuration.adoc
+++ b/manual/src/archives/1.4/asciidoc/configuration.adoc
@@ -211,24 +211,24 @@
 ==== Securing a production environment
 
 Before going live with a project, you should _absolutely_ read the following section that will help you setup a proper
-secure environment for running your context server. 
+secure environment for running your context server.
 
-Step 1: Install and configure a firewall 
+Step 1: Install and configure a firewall
 
 You should setup a firewall around your cluster of context servers and/or Elasticsearch nodes. If you have an
-application-level firewall you should only allow the following connections open to the whole world : 
+application-level firewall you should only allow the following connections open to the whole world :
 
-* http://localhost:8181/context.js[http://localhost:8181/context.js]
-* http://localhost:8181/eventcollector[http://localhost:8181/eventcollector]
+* http://localhost:8181/cxs/context.js[http://localhost:8181/cxs/context.js]
+* http://localhost:8181/cxs/eventcollector[http://localhost:8181/cxs/eventcollector]
 
 All other ports should not be accessible to the world.
 
 For your Apache Unomi client applications (such as the Jahia CMS), you will need to make the following ports
-accessible : 
+accessible :
 
 [source]
 ----
-8181 (Context Server HTTP port) 
+8181 (Context Server HTTP port)
 9443 (Context Server HTTPS port)
 ----
 
@@ -236,11 +236,11 @@
 highly recommended that you design your client applications to use the HTTPS port for accessing the REST API.
 
 The user accounts to access the REST API are actually routed through Karaf's JAAS support, which you may find the
-documentation for here : 
+documentation for here :
 
 * http://karaf.apache.org/manual/latest/users-guide/security.html[http://karaf.apache.org/manual/latest/users-guide/security.html]
 
-The default username/password is 
+The default username/password is
 
 [source]
 ----
@@ -265,7 +265,7 @@
 
 Step 2 : Follow industry recommended best practices for securing Elasticsearch
 
-You may find more valuable recommendations here : 
+You may find more valuable recommendations here :
 
 * https://www.elastic.co/blog/found-elasticsearch-security[https://www.elastic.co/blog/found-elasticsearch-security]
 * https://www.elastic.co/blog/scripting-security[https://www.elastic.co/blog/scripting-security]
@@ -420,7 +420,7 @@
 . Download http://central.maven.org/maven2/org/bouncycastle/bcpkix-jdk15on/1.55/bcpkix-jdk15on-1.55.jar[http://central.maven.org/maven2/org/bouncycastle/bcpkix-jdk15on/1.55/bcpkix-jdk15on-1.55.jar] to XPACK_JARS_DIRECTORY
 . Download http://central.maven.org/maven2/org/bouncycastle/bcprov-jdk15on/1.55/bcprov-jdk15on-1.55.jar[http://central.maven.org/maven2/org/bouncycastle/bcprov-jdk15on/1.55/bcprov-jdk15on-1.55.jar] to XPACK_JARS_DIRECTORY
 . Download http://central.maven.org/maven2/com/sun/mail/javax.mail/1.5.3/javax.mail-1.5.3.jar[http://central.maven.org/maven2/com/sun/mail/javax.mail/1.5.3/javax.mail-1.5.3.jar] to XPACK_JARS_DIRECTORY
-. 
+.
 
 Edit etc/org.apache.unomi.persistence.elasticsearch.cfg to add the following settings:
 
@@ -439,7 +439,7 @@
 transportClientProperties=xpack.security.user=elastic:changeme,xpack.ssl.key=/home/user/elasticsearch-5.6.3/config/x-pack/localhost/localhost.key,xpack.ssl.certificate=/home/user/elasticsearch-5.6.3/config/x-pack/localhost/localhost.crt,xpack.ssl.certificate_authorities=/home/user/elasticsearch-5.6.3/config/x-pack/ca/ca.crt,xpack.security.transport.ssl.enabled=true
 ----
 
-. 
+.
 
 Launch Karaf and launch unomi using the command from the shell :
 
@@ -466,4 +466,4 @@
 [source]
 ----
 config:property-set transportClientProperties xpack.security.user=elastic:changeme,xpack.ssl.key=/home/user/elasticsearch-5.6.3/config/x-pack/localhost/localhost.key,xpack.ssl.certificate=/home/user/elasticsearch-5.6.3/config/x-pack/localhost/localhost.crt,xpack.ssl.certificate_authorities=/home/user/elasticsearch-5.6.3/config/x-pack/ca/ca.crt,xpack.security.transport.ssl.enabled=true
-----
\ No newline at end of file
+----
diff --git a/manual/src/archives/1.4/asciidoc/consent-api.adoc b/manual/src/archives/1.4/asciidoc/consent-api.adoc
index ee6107d..02657c2 100644
--- a/manual/src/archives/1.4/asciidoc/consent-api.adoc
+++ b/manual/src/archives/1.4/asciidoc/consent-api.adoc
@@ -33,7 +33,7 @@
 
 [source]
 ----
-curl -X POST http://localhost:8181/context.json?sessionId=1234 \
+curl -X POST http://localhost:8181/cxs/context.json?sessionId=1234 \
 -H "Content-Type: application/json" \
 -d @- <<'EOF'
 {
@@ -77,7 +77,7 @@
 ==== Consent type definitions
 
 Apache Unomi does not manage consent definitions, it leaves that to an external system (for example a CMS) so that it
-can handle user-facing UIs to create, update, internationalize and present consent definitions to end users. 
+can handle user-facing UIs to create, update, internationalize and present consent definitions to end users.
 
 The only thing that is import to Apache Unomi to manage visitor consents is a globally unique key, that is called the
 consent type.
@@ -124,7 +124,7 @@
 
 [source]
 ----
-curl -X POST http://localhost:8181/context.json?sessionId=1234 \
+curl -X POST http://localhost:8181/cxs/context.json?sessionId=1234 \
 -H "Content-Type: application/json" \
 -d @- <<'EOF'
 {
@@ -195,4 +195,4 @@
 As we can see this rule is pretty simple it will simply execute the modifyConsentAction that is implemented by the
 https://github.com/apache/unomi/blob/9f1bab437fd93826dc54d318ed00d3b2e3161437/plugins/baseplugin/src/main/java/org/apache/unomi/plugins/baseplugin/actions/ModifyConsentAction.java[ModifyConsentAction Java class]
 
-This class will update the current visitor profile to add/update/revoke any consents that are included in the event.
\ No newline at end of file
+This class will update the current visitor profile to add/update/revoke any consents that are included in the event.
diff --git a/manual/src/archives/1.4/asciidoc/getting-started.adoc b/manual/src/archives/1.4/asciidoc/getting-started.adoc
index e478de6..3105a4a 100644
--- a/manual/src/archives/1.4/asciidoc/getting-started.adoc
+++ b/manual/src/archives/1.4/asciidoc/getting-started.adoc
@@ -42,7 +42,7 @@
 ----
 
 This indicates that all the Unomi services are started and ready to react to requests. You can then open a browser and go to `http://localhost:8181/cxs` to see the list of
-available RESTful services or retrieve an initial context at `http://localhost:8181/context.json` (which isn't very useful at this point).
+available RESTful services or retrieve an initial context at `http://localhost:8181/cxs/context.json` (which isn't very useful at this point).
 
 Now that your service is up and running you can go look at the <<_request-examples,request examples>> to learn basic
-requests you can do once your server is up and running.
\ No newline at end of file
+requests you can do once your server is up and running.
diff --git a/manual/src/archives/1.4/asciidoc/how-profile-tracking-works.adoc b/manual/src/archives/1.4/asciidoc/how-profile-tracking-works.adoc
index 1a5790f..0296dd3 100644
--- a/manual/src/archives/1.4/asciidoc/how-profile-tracking-works.adoc
+++ b/manual/src/archives/1.4/asciidoc/how-profile-tracking-works.adoc
@@ -19,7 +19,7 @@
 
 1. A visitor comes to a website
 2. The web server resolves a previous request session ID if it exists, or if it doesn't it create a new sessionID
-3. A request to Apache Unomi's /context.json servlet is made passing the web server session ID as a query parameter
+3. A request to Apache Unomi's /cxs/context.json servlet is made passing the web server session ID as a query parameter
 4. Unomi uses the sessionID and tries to load an existing session, if none is found a new session is created with the
 ID passed by the web server
 5. If a session was found, the profile ID is extracted from the session and if it not found, Unomi looks for a cookie
diff --git a/manual/src/archives/1.4/asciidoc/privacy.adoc b/manual/src/archives/1.4/asciidoc/privacy.adoc
index 93eb353..d1265ef 100644
--- a/manual/src/archives/1.4/asciidoc/privacy.adoc
+++ b/manual/src/archives/1.4/asciidoc/privacy.adoc
@@ -55,7 +55,7 @@
 
 [source]
 ----
-curl -X GET http://localhost:8181/client/myprofile.[json,csv,yaml,text] \
+curl -X GET http://localhost:8181/cxs/client/myprofile.[json,csv,yaml,text] \
 --cookie "context-profile-id=PROFILE-ID"
 ----
 
diff --git a/manual/src/archives/1.4/asciidoc/recipes.adoc b/manual/src/archives/1.4/asciidoc/recipes.adoc
index 165c8b7..f8bf2db 100644
--- a/manual/src/archives/1.4/asciidoc/recipes.adoc
+++ b/manual/src/archives/1.4/asciidoc/recipes.adoc
@@ -20,14 +20,14 @@
 
 ==== How to read a profile
 
-The simplest way to retrieve profile data for the current profile is to simply send a request to the /context.json
+The simplest way to retrieve profile data for the current profile is to simply send a request to the /cxs/context.json
 endpoint. However you will need to send a body along with that request. Here's an example:
 
 Here is an example that will retrieve all the session and profile properties.
 
 [source]
 ----
-curl -X POST http://localhost:8181/context.json?sessionId=1234 \
+curl -X POST http://localhost:8181/cxs/context.json?sessionId=1234 \
 -H "Content-Type: application/json" \
 -d @- <<'EOF'
 {
@@ -49,7 +49,7 @@
 Java class.
 
 Note that it is also possible to access a profile's data through the /cxs/profiles/ endpoint but that really should be
-reserved to administrative purposes. All public accesses should always use the /context.json endpoint for consistency
+reserved to administrative purposes. All public accesses should always use the /cxs/context.json endpoint for consistency
 and security.
 
 ==== How to update a profile from the public internet
@@ -149,7 +149,7 @@
 
 [source]
 ----
-curl -X POST http://localhost:8181/eventcollector \
+curl -X POST http://localhost:8181/cxs/eventcollector \
 -H "Content-Type: application/json" \
 -d @- <<'EOF'
 {
diff --git a/manual/src/archives/1.4/asciidoc/request-examples.adoc b/manual/src/archives/1.4/asciidoc/request-examples.adoc
index d4afd5a..9b56a3b 100644
--- a/manual/src/archives/1.4/asciidoc/request-examples.adoc
+++ b/manual/src/archives/1.4/asciidoc/request-examples.adoc
@@ -19,7 +19,7 @@
 
 [source]
 ----
-curl http://localhost:8181/context.js?sessionId=1234
+curl http://localhost:8181/cxs/context.js?sessionId=1234
 ----
 
 This will retrieve a JavaScript script that contains a `cxs` object that contains the context with the current user
@@ -32,7 +32,7 @@
 
 [source]
 ----
-curl http://localhost:8181/context.json?sessionId=1234
+curl http://localhost:8181/cxs/context.json?sessionId=1234
 ----
 
 ==== Accessing profile properties in a context
@@ -45,7 +45,7 @@
 
 [source]
 ----
-curl -X POST http://localhost:8181/context.json?sessionId=1234 \
+curl -X POST http://localhost:8181/cxs/context.json?sessionId=1234 \
 -H "Content-Type: application/json" \
 -d @- <<'EOF'
 {
@@ -73,7 +73,7 @@
 
 [source]
 ----
-curl -X POST http://localhost:8181/context.json?sessionId=1234 \
+curl -X POST http://localhost:8181/cxs/context.json?sessionId=1234 \
 -H "Content-Type: application/json" \
 -d @- <<'EOF'
 {
@@ -119,7 +119,7 @@
 
 [source]
 ----
-curl -X POST http://localhost:8181/eventcollector \
+curl -X POST http://localhost:8181/cxs/eventcollector \
 -H "Content-Type: application/json" \
 -d @- <<'EOF'
 {
@@ -156,4 +156,4 @@
 
 * You can find more <<_useful_apache_unomi_urls,useful Apache Unomi URLs>> that can be used in the same way as the above examples.
 * You may want to know integrate the provided <<_web_tracker,web tracker>> into your web site.
-* Read the <<_twitter_sample,Twitter sample>> documentation that contains a detailed example of how to integrate with Apache Unomi.
\ No newline at end of file
+* Read the <<_twitter_sample,Twitter sample>> documentation that contains a detailed example of how to integrate with Apache Unomi.
diff --git a/manual/src/archives/1.4/asciidoc/samples/twitter-sample.adoc b/manual/src/archives/1.4/asciidoc/samples/twitter-sample.adoc
index 09cac27..5571f0c 100644
--- a/manual/src/archives/1.4/asciidoc/samples/twitter-sample.adoc
+++ b/manual/src/archives/1.4/asciidoc/samples/twitter-sample.adoc
@@ -63,7 +63,7 @@
 
 ==== Retrieving context information from Unomi using the context servlet
 
-Unomi provides two ways to retrieve context: either as a pure JSON object containing strictly context information or as a couple of JSON objects augmented with javascript functions that can be used to interact with the Unomi server using the `&lt;context server base URL&gt;/context.json` or `&lt;context server base URL&gt;/context.js` URLs, respectively.
+Unomi provides two ways to retrieve context: either as a pure JSON object containing strictly context information or as a couple of JSON objects augmented with javascript functions that can be used to interact with the Unomi server using the `&lt;context server base URL&gt;/cxs/context.json` or `&lt;context server base URL&gt;/context.js` URLs, respectively.
 
 Below is an example of asynchronously loading the initial context using the javascript version, assuming a default Unomi install running on `http://localhost:8181`:
 
@@ -75,7 +75,7 @@
     if (document.getElementById(id)) return;
     js = document.createElement(elementToCreate);
     js.id = id;
-    js.src = 'http://localhost:8181/context.js';
+    js.src = 'http://localhost:8181/cxs/context.js';
     fjs.parentNode.insertBefore(js, fjs);
 }(document, 'script', 'context'));
 
@@ -121,7 +121,7 @@
     var data = JSON.stringify(payload);
     // if we don't already have a session id, generate one
     var sessionId = cxs.sessionId || generateUUID();
-    var url = 'http://localhost:8181/context.json?sessionId=' + sessionId;
+    var url = 'http://localhost:8181/cxs/context.json?sessionId=' + sessionId;
     var xhr = new XMLHttpRequest();
     var isGet = data.length < 100;
     if (isGet) {
@@ -165,7 +165,7 @@
 * If we specify a payload, it is expected to use the JSON format so we `stringify` it and encode it if passed as a URL parameter in a `GET` request.
 * We need to make a https://developer.mozilla.org/en-US/docs/Web/HTTP/Access_control_CORS[`CORS`] request since the Unomi server is most likely not running on the same host than the one from which the request originates. The specific details are fairly standard and we will not explain them here.
 * We need to either retrieve (from the initial context we retrieved previously using `cxs.sessionId`) or generate a session identifier for our request since Unomi currently requires one.
-* We're calling the `ContextServlet` using the default install URI, specifying the session identifier: `http://localhost:8181/context.json?sessionId=&#39; + sessionId`. This URI requests context from Unomi, resulting in an updated `cxs` object in the javascript global scope. The context server can reply to this request either by returning a JSON-only object containing solely the context information as is the case when the requested URI is `context.json`. However, if the client requests `context.js` then useful functions to interact with Unomi are added to the `cxs` object in addition to the context information as depicted above.
+* We're calling the `ContextServlet` using the default install URI, specifying the session identifier: `http://localhost:8181/cxs/context.json?sessionId=&#39; + sessionId`. This URI requests context from Unomi, resulting in an updated `cxs` object in the javascript global scope. The context server can reply to this request either by returning a JSON-only object containing solely the context information as is the case when the requested URI is `context.json`. However, if the client requests `context.js` then useful functions to interact with Unomi are added to the `cxs` object in addition to the context information as depicted above.
 * We don't need to provide any authentication at all to interact with this part of Unomi since we only have access to read-only data (as well as providing events as we shall see later on). If we had been using the REST API, we would have needed to provide authentication information as well.
 
 ===== Context request and response structure
diff --git a/manual/src/archives/1.5/asciidoc/5-min-quickstart.adoc b/manual/src/archives/1.5/asciidoc/5-min-quickstart.adoc
index 3725874..92fdb65 100644
--- a/manual/src/archives/1.5/asciidoc/5-min-quickstart.adoc
+++ b/manual/src/archives/1.5/asciidoc/5-min-quickstart.adoc
@@ -32,7 +32,7 @@
 
 9) Try accessing https://localhost:9443/cxs/cluster with username/password: `karaf/karaf` . You might get a certificate warning in your browser, just accept it despite the warning it is safe.
 
-10) Request your first context by simply accessing : http://localhost:8181/context.js?sessionId=1234
+10) Request your first context by simply accessing : http://localhost:8181/cxs/context.js?sessionId=1234
 
 11) If something goes wrong, you should check the logs in `./data/log/karaf.log`. If you get errors on ElasticSearch,
 make sure you are using the proper version.
@@ -41,4 +41,4 @@
 
 - Connect to http://localhost:8181 to try our some live examples (such as the web tracker)
 - Trying our integration <<Samples,samples page>>
-- Learning more about the <<Web Tracker,web tracker>>
\ No newline at end of file
+- Learning more about the <<Web Tracker,web tracker>>
diff --git a/manual/src/archives/1.5/asciidoc/building-and-deploying.adoc b/manual/src/archives/1.5/asciidoc/building-and-deploying.adoc
index ec74505..19d9a8d 100644
--- a/manual/src/archives/1.5/asciidoc/building-and-deploying.adoc
+++ b/manual/src/archives/1.5/asciidoc/building-and-deploying.adoc
@@ -82,7 +82,7 @@
 
 Check that the ElasticSearch is up and running by accessing the following URL :
 
-http://localhost:9200[http://localhost:9200] 
+http://localhost:9200[http://localhost:9200]
 
 ==== Deploying the generated binary package
 
@@ -90,14 +90,14 @@
 Simply uncompress the package/target/unomi-VERSION.tar.gz (for Linux or Mac OS X) or
  package/target/unomi-VERSION.zip (for Windows) archive into the directory of your choice.
 
-You can then start the server simply by using the command on UNIX/Linux/MacOS X : 
+You can then start the server simply by using the command on UNIX/Linux/MacOS X :
 
 [source]
 ----
-./bin/karaf    
+./bin/karaf
 ----
 
-or on Windows shell : 
+or on Windows shell :
 
 [source]
 ----
@@ -109,7 +109,7 @@
 
 [source]
 ----
-unomi:start        
+unomi:start
 ----
 
 ==== Deploying into an existing Karaf server
@@ -155,14 +155,14 @@
 ==== JDK Selection on Mac OS X
 
 You might need to select the JDK to run the tests in the itests subproject. In order to do so you can list the
-installed JDKs with the following command : 
+installed JDKs with the following command :
 
 [source]
 ----
 /usr/libexec/java_home -V
 ----
 
-which will output something like this : 
+which will output something like this :
 
 [source]
 ----
@@ -174,21 +174,21 @@
 /Library/Java/JavaVirtualMachines/openjdk-11.jdk/Contents/Home
 ----
 
-You can then select the one you want using : 
+You can then select the one you want using :
 
 [source]
 ----
 export JAVA_HOME=`/usr/libexec/java_home -v 1.8.0_181`
 ----
 
-and then check that it was correctly referenced using: 
+and then check that it was correctly referenced using:
 
 [source]
 ----
 java -version
 ----
 
-which should give you a result such as this: 
+which should give you a result such as this:
 
 [source]
 ----
@@ -202,11 +202,11 @@
 The integration tests are not executed by default to make build time minimal, but it is recommended to run the
 integration tests at least once before using the server to make sure that everything is ok in the build. Another way
 to use these tests is to run them from a continuous integration server such as Jenkins, Apache Gump, Atlassian Bamboo or
- others. 
+ others.
 
 Note : the integration tests require a JDK 8 or more recent !
 
-To run the tests simply activate the following profile : 
+To run the tests simply activate the following profile :
 
 [source]
 ----
@@ -240,6 +240,6 @@
    http://localhost:8181/index.html
 ----
 
-This test page will trigger the loading of the /context.js script, which will try to retrieving the user context
+This test page will trigger the loading of the /cxs/context.js script, which will try to retrieving the user context
 or create a new one if it doesn't exist yet. It also contains an experimental integration with Facebook Login, but it
 doesn't yet save the context back to the context server.
diff --git a/manual/src/archives/1.5/asciidoc/configuration.adoc b/manual/src/archives/1.5/asciidoc/configuration.adoc
index f416071..c299569 100644
--- a/manual/src/archives/1.5/asciidoc/configuration.adoc
+++ b/manual/src/archives/1.5/asciidoc/configuration.adoc
@@ -199,7 +199,7 @@
 
 The scripting security system is multi-layered.
 
-For requests coming in through the /context.json endpoint, the following flow is used to secure incoming requests:
+For requests coming in through the /cxs/context.json endpoint, the following flow is used to secure incoming requests:
 
 image::expression-filtering-layers.png[Expression filtering layers]
 
@@ -372,7 +372,7 @@
 # This parameter controls whether OGNL scripting is allowed in expressions. Because of security reasons it is deactivated by default. If you run into compatibility issues you could reactivate it but it is at your own risk.
 org.apache.unomi.security.properties.useOGNLScripting=${env:UNOMI_SCRIPTING_USE_OGNL:-false}
 
-# This parameter controls the condition sanitizing done on the ContextServlet (/context.json). If will remove any expressions that start with "script::". It is not recommended to change this value, unless you run into compatibility issues.
+# This parameter controls the condition sanitizing done on the ContextServlet (/cxs/context.json). If will remove any expressions that start with "script::". It is not recommended to change this value, unless you run into compatibility issues.
 org.apache.unomi.security.personalization.sanitizeConditions=${env:UNOMI_SECURITY_SANITIZEPERSONALIZATIONCONDITIONS:-true}
 ----
 
@@ -406,24 +406,24 @@
 === Securing a production environment
 
 Before going live with a project, you should _absolutely_ read the following section that will help you setup a proper
-secure environment for running your context server. 
+secure environment for running your context server.
 
-Step 1: Install and configure a firewall 
+Step 1: Install and configure a firewall
 
 You should setup a firewall around your cluster of context servers and/or Elasticsearch nodes. If you have an
-application-level firewall you should only allow the following connections open to the whole world : 
+application-level firewall you should only allow the following connections open to the whole world :
 
-* http://localhost:8181/context.js[http://localhost:8181/context.js]
-* http://localhost:8181/eventcollector[http://localhost:8181/eventcollector]
+* http://localhost:8181/cxs/context.js[http://localhost:8181/cxs/context.js]
+* http://localhost:8181/cxs/eventcollector[http://localhost:8181/cxs/eventcollector]
 
 All other ports should not be accessible to the world.
 
 For your Apache Unomi client applications (such as the Jahia CMS), you will need to make the following ports
-accessible : 
+accessible :
 
 [source]
 ----
-8181 (Context Server HTTP port) 
+8181 (Context Server HTTP port)
 9443 (Context Server HTTPS port)
 ----
 
@@ -431,11 +431,11 @@
 highly recommended that you design your client applications to use the HTTPS port for accessing the REST API.
 
 The user accounts to access the REST API are actually routed through Karaf's JAAS support, which you may find the
-documentation for here : 
+documentation for here :
 
 * http://karaf.apache.org/manual/latest/users-guide/security.html[http://karaf.apache.org/manual/latest/users-guide/security.html]
 
-The default username/password is 
+The default username/password is
 
 [source]
 ----
@@ -460,7 +460,7 @@
 
 Step 2 : Follow industry recommended best practices for securing Elasticsearch
 
-You may find more valuable recommendations here : 
+You may find more valuable recommendations here :
 
 * https://www.elastic.co/blog/found-elasticsearch-security[https://www.elastic.co/blog/found-elasticsearch-security]
 * https://www.elastic.co/blog/scripting-security[https://www.elastic.co/blog/scripting-security]
diff --git a/manual/src/archives/1.5/asciidoc/consent-api.adoc b/manual/src/archives/1.5/asciidoc/consent-api.adoc
index ee6107d..02657c2 100644
--- a/manual/src/archives/1.5/asciidoc/consent-api.adoc
+++ b/manual/src/archives/1.5/asciidoc/consent-api.adoc
@@ -33,7 +33,7 @@
 
 [source]
 ----
-curl -X POST http://localhost:8181/context.json?sessionId=1234 \
+curl -X POST http://localhost:8181/cxs/context.json?sessionId=1234 \
 -H "Content-Type: application/json" \
 -d @- <<'EOF'
 {
@@ -77,7 +77,7 @@
 ==== Consent type definitions
 
 Apache Unomi does not manage consent definitions, it leaves that to an external system (for example a CMS) so that it
-can handle user-facing UIs to create, update, internationalize and present consent definitions to end users. 
+can handle user-facing UIs to create, update, internationalize and present consent definitions to end users.
 
 The only thing that is import to Apache Unomi to manage visitor consents is a globally unique key, that is called the
 consent type.
@@ -124,7 +124,7 @@
 
 [source]
 ----
-curl -X POST http://localhost:8181/context.json?sessionId=1234 \
+curl -X POST http://localhost:8181/cxs/context.json?sessionId=1234 \
 -H "Content-Type: application/json" \
 -d @- <<'EOF'
 {
@@ -195,4 +195,4 @@
 As we can see this rule is pretty simple it will simply execute the modifyConsentAction that is implemented by the
 https://github.com/apache/unomi/blob/9f1bab437fd93826dc54d318ed00d3b2e3161437/plugins/baseplugin/src/main/java/org/apache/unomi/plugins/baseplugin/actions/ModifyConsentAction.java[ModifyConsentAction Java class]
 
-This class will update the current visitor profile to add/update/revoke any consents that are included in the event.
\ No newline at end of file
+This class will update the current visitor profile to add/update/revoke any consents that are included in the event.
diff --git a/manual/src/archives/1.5/asciidoc/getting-started.adoc b/manual/src/archives/1.5/asciidoc/getting-started.adoc
index 52f5d0c..4c67232 100644
--- a/manual/src/archives/1.5/asciidoc/getting-started.adoc
+++ b/manual/src/archives/1.5/asciidoc/getting-started.adoc
@@ -61,10 +61,10 @@
 ----
 
 This indicates that all the Unomi services are started and ready to react to requests. You can then open a browser and go to `http://localhost:8181/cxs` to see the list of
-available RESTful services or retrieve an initial context at `http://localhost:8181/context.json` (which isn't very useful at this point).
+available RESTful services or retrieve an initial context at `http://localhost:8181/cxs/context.json` (which isn't very useful at this point).
 
 You can now find an introduction page at the following location: http://localhost:8181
 
 Also now that your service is up and running you can go look at the
 <<Request examples,request examples>> to learn basic
-requests you can do once your server is up and running.
\ No newline at end of file
+requests you can do once your server is up and running.
diff --git a/manual/src/archives/1.5/asciidoc/how-profile-tracking-works.adoc b/manual/src/archives/1.5/asciidoc/how-profile-tracking-works.adoc
index 1a5790f..0296dd3 100644
--- a/manual/src/archives/1.5/asciidoc/how-profile-tracking-works.adoc
+++ b/manual/src/archives/1.5/asciidoc/how-profile-tracking-works.adoc
@@ -19,7 +19,7 @@
 
 1. A visitor comes to a website
 2. The web server resolves a previous request session ID if it exists, or if it doesn't it create a new sessionID
-3. A request to Apache Unomi's /context.json servlet is made passing the web server session ID as a query parameter
+3. A request to Apache Unomi's /cxs/context.json servlet is made passing the web server session ID as a query parameter
 4. Unomi uses the sessionID and tries to load an existing session, if none is found a new session is created with the
 ID passed by the web server
 5. If a session was found, the profile ID is extracted from the session and if it not found, Unomi looks for a cookie
diff --git a/manual/src/archives/1.5/asciidoc/privacy.adoc b/manual/src/archives/1.5/asciidoc/privacy.adoc
index c42842a..530af94 100644
--- a/manual/src/archives/1.5/asciidoc/privacy.adoc
+++ b/manual/src/archives/1.5/asciidoc/privacy.adoc
@@ -55,7 +55,7 @@
 
 [source]
 ----
-curl -X GET http://localhost:8181/client/myprofile.[json,csv,yaml,text] \
+curl -X GET http://localhost:8181/cxs/client/myprofile.[json,csv,yaml,text] \
 --cookie "context-profile-id=PROFILE-ID"
 ----
 
diff --git a/manual/src/archives/1.5/asciidoc/recipes.adoc b/manual/src/archives/1.5/asciidoc/recipes.adoc
index 165c8b7..f8bf2db 100644
--- a/manual/src/archives/1.5/asciidoc/recipes.adoc
+++ b/manual/src/archives/1.5/asciidoc/recipes.adoc
@@ -20,14 +20,14 @@
 
 ==== How to read a profile
 
-The simplest way to retrieve profile data for the current profile is to simply send a request to the /context.json
+The simplest way to retrieve profile data for the current profile is to simply send a request to the /cxs/context.json
 endpoint. However you will need to send a body along with that request. Here's an example:
 
 Here is an example that will retrieve all the session and profile properties.
 
 [source]
 ----
-curl -X POST http://localhost:8181/context.json?sessionId=1234 \
+curl -X POST http://localhost:8181/cxs/context.json?sessionId=1234 \
 -H "Content-Type: application/json" \
 -d @- <<'EOF'
 {
@@ -49,7 +49,7 @@
 Java class.
 
 Note that it is also possible to access a profile's data through the /cxs/profiles/ endpoint but that really should be
-reserved to administrative purposes. All public accesses should always use the /context.json endpoint for consistency
+reserved to administrative purposes. All public accesses should always use the /cxs/context.json endpoint for consistency
 and security.
 
 ==== How to update a profile from the public internet
@@ -149,7 +149,7 @@
 
 [source]
 ----
-curl -X POST http://localhost:8181/eventcollector \
+curl -X POST http://localhost:8181/cxs/eventcollector \
 -H "Content-Type: application/json" \
 -d @- <<'EOF'
 {
diff --git a/manual/src/archives/1.5/asciidoc/request-examples.adoc b/manual/src/archives/1.5/asciidoc/request-examples.adoc
index 49fba3f..33928cf 100644
--- a/manual/src/archives/1.5/asciidoc/request-examples.adoc
+++ b/manual/src/archives/1.5/asciidoc/request-examples.adoc
@@ -19,7 +19,7 @@
 
 [source]
 ----
-curl http://localhost:8181/context.js?sessionId=1234
+curl http://localhost:8181/cxs/context.js?sessionId=1234
 ----
 
 This will retrieve a JavaScript script that contains a `cxs` object that contains the context with the current user
@@ -32,7 +32,7 @@
 
 [source]
 ----
-curl http://localhost:8181/context.json?sessionId=1234
+curl http://localhost:8181/cxs/context.json?sessionId=1234
 ----
 
 ==== Accessing profile properties in a context
@@ -45,7 +45,7 @@
 
 [source]
 ----
-curl -X POST http://localhost:8181/context.json?sessionId=1234 \
+curl -X POST http://localhost:8181/cxs/context.json?sessionId=1234 \
 -H "Content-Type: application/json" \
 -d @- <<'EOF'
 {
@@ -73,7 +73,7 @@
 
 [source]
 ----
-curl -X POST http://localhost:8181/context.json?sessionId=1234 \
+curl -X POST http://localhost:8181/cxs/context.json?sessionId=1234 \
 -H "Content-Type: application/json" \
 -d @- <<'EOF'
 {
@@ -119,7 +119,7 @@
 
 [source]
 ----
-curl -X POST http://localhost:8181/eventcollector \
+curl -X POST http://localhost:8181/cxs/eventcollector \
 -H "Content-Type: application/json" \
 -d @- <<'EOF'
 {
@@ -156,4 +156,4 @@
 
 * You can find more <<Useful Apache Unomi URLs,useful Apache Unomi URLs>> that can be used in the same way as the above examples.
 * You may want to know integrate the provided <<Web Tracker,web tracker>> into your web site.
-* Read the <<Twitter sample,Twitter sample>> documentation that contains a detailed example of how to integrate with Apache Unomi.
\ No newline at end of file
+* Read the <<Twitter sample,Twitter sample>> documentation that contains a detailed example of how to integrate with Apache Unomi.
diff --git a/manual/src/archives/1.5/asciidoc/samples/twitter-sample.adoc b/manual/src/archives/1.5/asciidoc/samples/twitter-sample.adoc
index b0d6064..2a454e6 100644
--- a/manual/src/archives/1.5/asciidoc/samples/twitter-sample.adoc
+++ b/manual/src/archives/1.5/asciidoc/samples/twitter-sample.adoc
@@ -63,7 +63,7 @@
 
 ==== Retrieving context information from Unomi using the context servlet
 
-Unomi provides two ways to retrieve context: either as a pure JSON object containing strictly context information or as a couple of JSON objects augmented with javascript functions that can be used to interact with the Unomi server using the `&lt;context server base URL&gt;/context.json` or `&lt;context server base URL&gt;/context.js` URLs, respectively.
+Unomi provides two ways to retrieve context: either as a pure JSON object containing strictly context information or as a couple of JSON objects augmented with javascript functions that can be used to interact with the Unomi server using the `&lt;context server base URL&gt;/cxs/context.json` or `&lt;context server base URL&gt;/context.js` URLs, respectively.
 
 Below is an example of asynchronously loading the initial context using the javascript version, assuming a default Unomi install running on `http://localhost:8181`:
 
@@ -75,7 +75,7 @@
     if (document.getElementById(id)) return;
     js = document.createElement(elementToCreate);
     js.id = id;
-    js.src = 'http://localhost:8181/context.js';
+    js.src = 'http://localhost:8181/cxs/context.js';
     fjs.parentNode.insertBefore(js, fjs);
 }(document, 'script', 'context'));
 
@@ -121,7 +121,7 @@
     var data = JSON.stringify(payload);
     // if we don't already have a session id, generate one
     var sessionId = cxs.sessionId || generateUUID();
-    var url = 'http://localhost:8181/context.json?sessionId=' + sessionId;
+    var url = 'http://localhost:8181/cxs/context.json?sessionId=' + sessionId;
     var xhr = new XMLHttpRequest();
     var isGet = data.length < 100;
     if (isGet) {
@@ -165,7 +165,7 @@
 * If we specify a payload, it is expected to use the JSON format so we `stringify` it and encode it if passed as a URL parameter in a `GET` request.
 * We need to make a https://developer.mozilla.org/en-US/docs/Web/HTTP/Access_control_CORS[`CORS`] request since the Unomi server is most likely not running on the same host than the one from which the request originates. The specific details are fairly standard and we will not explain them here.
 * We need to either retrieve (from the initial context we retrieved previously using `cxs.sessionId`) or generate a session identifier for our request since Unomi currently requires one.
-* We're calling the `ContextServlet` using the default install URI, specifying the session identifier: `http://localhost:8181/context.json?sessionId=&#39; + sessionId`. This URI requests context from Unomi, resulting in an updated `cxs` object in the javascript global scope. The context server can reply to this request either by returning a JSON-only object containing solely the context information as is the case when the requested URI is `context.json`. However, if the client requests `context.js` then useful functions to interact with Unomi are added to the `cxs` object in addition to the context information as depicted above.
+* We're calling the `ContextServlet` using the default install URI, specifying the session identifier: `http://localhost:8181/cxs/context.json?sessionId=&#39; + sessionId`. This URI requests context from Unomi, resulting in an updated `cxs` object in the javascript global scope. The context server can reply to this request either by returning a JSON-only object containing solely the context information as is the case when the requested URI is `context.json`. However, if the client requests `context.js` then useful functions to interact with Unomi are added to the `cxs` object in addition to the context information as depicted above.
 * We don't need to provide any authentication at all to interact with this part of Unomi since we only have access to read-only data (as well as providing events as we shall see later on). If we had been using the REST API, we would have needed to provide authentication information as well.
 
 ===== Context request and response structure
diff --git a/manual/src/archives/1.5/asciidoc/updating-events.adoc b/manual/src/archives/1.5/asciidoc/updating-events.adoc
index 84a3909..7e2d52f 100644
--- a/manual/src/archives/1.5/asciidoc/updating-events.adoc
+++ b/manual/src/archives/1.5/asciidoc/updating-events.adoc
@@ -28,7 +28,7 @@
 
 [source]
 ----
-curl -X POST http://localhost:8181/context.json \
+curl -X POST http://localhost:8181/cxs/context.json \
 -H "Content-Type: application/json" \
 -d @- <<'EOF'
 {
@@ -54,7 +54,7 @@
 
 [source]
 ----
-curl -X POST http://localhost:8181/context.json \
+curl -X POST http://localhost:8181/cxs/context.json \
 -H "Content-Type: application/json" \
 -d @- <<'EOF'
 {
@@ -82,4 +82,4 @@
   ]
 }
 EOF
-----
\ No newline at end of file
+----
diff --git a/manual/src/main/asciidoc/5-min-quickstart.adoc b/manual/src/main/asciidoc/5-min-quickstart.adoc
index 3725874..92fdb65 100644
--- a/manual/src/main/asciidoc/5-min-quickstart.adoc
+++ b/manual/src/main/asciidoc/5-min-quickstart.adoc
@@ -32,7 +32,7 @@
 
 9) Try accessing https://localhost:9443/cxs/cluster with username/password: `karaf/karaf` . You might get a certificate warning in your browser, just accept it despite the warning it is safe.
 
-10) Request your first context by simply accessing : http://localhost:8181/context.js?sessionId=1234
+10) Request your first context by simply accessing : http://localhost:8181/cxs/context.js?sessionId=1234
 
 11) If something goes wrong, you should check the logs in `./data/log/karaf.log`. If you get errors on ElasticSearch,
 make sure you are using the proper version.
@@ -41,4 +41,4 @@
 
 - Connect to http://localhost:8181 to try our some live examples (such as the web tracker)
 - Trying our integration <<Samples,samples page>>
-- Learning more about the <<Web Tracker,web tracker>>
\ No newline at end of file
+- Learning more about the <<Web Tracker,web tracker>>
diff --git a/manual/src/main/asciidoc/building-and-deploying.adoc b/manual/src/main/asciidoc/building-and-deploying.adoc
index ec74505..19d9a8d 100644
--- a/manual/src/main/asciidoc/building-and-deploying.adoc
+++ b/manual/src/main/asciidoc/building-and-deploying.adoc
@@ -82,7 +82,7 @@
 
 Check that the ElasticSearch is up and running by accessing the following URL :
 
-http://localhost:9200[http://localhost:9200] 
+http://localhost:9200[http://localhost:9200]
 
 ==== Deploying the generated binary package
 
@@ -90,14 +90,14 @@
 Simply uncompress the package/target/unomi-VERSION.tar.gz (for Linux or Mac OS X) or
  package/target/unomi-VERSION.zip (for Windows) archive into the directory of your choice.
 
-You can then start the server simply by using the command on UNIX/Linux/MacOS X : 
+You can then start the server simply by using the command on UNIX/Linux/MacOS X :
 
 [source]
 ----
-./bin/karaf    
+./bin/karaf
 ----
 
-or on Windows shell : 
+or on Windows shell :
 
 [source]
 ----
@@ -109,7 +109,7 @@
 
 [source]
 ----
-unomi:start        
+unomi:start
 ----
 
 ==== Deploying into an existing Karaf server
@@ -155,14 +155,14 @@
 ==== JDK Selection on Mac OS X
 
 You might need to select the JDK to run the tests in the itests subproject. In order to do so you can list the
-installed JDKs with the following command : 
+installed JDKs with the following command :
 
 [source]
 ----
 /usr/libexec/java_home -V
 ----
 
-which will output something like this : 
+which will output something like this :
 
 [source]
 ----
@@ -174,21 +174,21 @@
 /Library/Java/JavaVirtualMachines/openjdk-11.jdk/Contents/Home
 ----
 
-You can then select the one you want using : 
+You can then select the one you want using :
 
 [source]
 ----
 export JAVA_HOME=`/usr/libexec/java_home -v 1.8.0_181`
 ----
 
-and then check that it was correctly referenced using: 
+and then check that it was correctly referenced using:
 
 [source]
 ----
 java -version
 ----
 
-which should give you a result such as this: 
+which should give you a result such as this:
 
 [source]
 ----
@@ -202,11 +202,11 @@
 The integration tests are not executed by default to make build time minimal, but it is recommended to run the
 integration tests at least once before using the server to make sure that everything is ok in the build. Another way
 to use these tests is to run them from a continuous integration server such as Jenkins, Apache Gump, Atlassian Bamboo or
- others. 
+ others.
 
 Note : the integration tests require a JDK 8 or more recent !
 
-To run the tests simply activate the following profile : 
+To run the tests simply activate the following profile :
 
 [source]
 ----
@@ -240,6 +240,6 @@
    http://localhost:8181/index.html
 ----
 
-This test page will trigger the loading of the /context.js script, which will try to retrieving the user context
+This test page will trigger the loading of the /cxs/context.js script, which will try to retrieving the user context
 or create a new one if it doesn't exist yet. It also contains an experimental integration with Facebook Login, but it
 doesn't yet save the context back to the context server.
diff --git a/manual/src/main/asciidoc/configuration.adoc b/manual/src/main/asciidoc/configuration.adoc
index f416071..c299569 100644
--- a/manual/src/main/asciidoc/configuration.adoc
+++ b/manual/src/main/asciidoc/configuration.adoc
@@ -199,7 +199,7 @@
 
 The scripting security system is multi-layered.
 
-For requests coming in through the /context.json endpoint, the following flow is used to secure incoming requests:
+For requests coming in through the /cxs/context.json endpoint, the following flow is used to secure incoming requests:
 
 image::expression-filtering-layers.png[Expression filtering layers]
 
@@ -372,7 +372,7 @@
 # This parameter controls whether OGNL scripting is allowed in expressions. Because of security reasons it is deactivated by default. If you run into compatibility issues you could reactivate it but it is at your own risk.
 org.apache.unomi.security.properties.useOGNLScripting=${env:UNOMI_SCRIPTING_USE_OGNL:-false}
 
-# This parameter controls the condition sanitizing done on the ContextServlet (/context.json). If will remove any expressions that start with "script::". It is not recommended to change this value, unless you run into compatibility issues.
+# This parameter controls the condition sanitizing done on the ContextServlet (/cxs/context.json). If will remove any expressions that start with "script::". It is not recommended to change this value, unless you run into compatibility issues.
 org.apache.unomi.security.personalization.sanitizeConditions=${env:UNOMI_SECURITY_SANITIZEPERSONALIZATIONCONDITIONS:-true}
 ----
 
@@ -406,24 +406,24 @@
 === Securing a production environment
 
 Before going live with a project, you should _absolutely_ read the following section that will help you setup a proper
-secure environment for running your context server. 
+secure environment for running your context server.
 
-Step 1: Install and configure a firewall 
+Step 1: Install and configure a firewall
 
 You should setup a firewall around your cluster of context servers and/or Elasticsearch nodes. If you have an
-application-level firewall you should only allow the following connections open to the whole world : 
+application-level firewall you should only allow the following connections open to the whole world :
 
-* http://localhost:8181/context.js[http://localhost:8181/context.js]
-* http://localhost:8181/eventcollector[http://localhost:8181/eventcollector]
+* http://localhost:8181/cxs/context.js[http://localhost:8181/cxs/context.js]
+* http://localhost:8181/cxs/eventcollector[http://localhost:8181/cxs/eventcollector]
 
 All other ports should not be accessible to the world.
 
 For your Apache Unomi client applications (such as the Jahia CMS), you will need to make the following ports
-accessible : 
+accessible :
 
 [source]
 ----
-8181 (Context Server HTTP port) 
+8181 (Context Server HTTP port)
 9443 (Context Server HTTPS port)
 ----
 
@@ -431,11 +431,11 @@
 highly recommended that you design your client applications to use the HTTPS port for accessing the REST API.
 
 The user accounts to access the REST API are actually routed through Karaf's JAAS support, which you may find the
-documentation for here : 
+documentation for here :
 
 * http://karaf.apache.org/manual/latest/users-guide/security.html[http://karaf.apache.org/manual/latest/users-guide/security.html]
 
-The default username/password is 
+The default username/password is
 
 [source]
 ----
@@ -460,7 +460,7 @@
 
 Step 2 : Follow industry recommended best practices for securing Elasticsearch
 
-You may find more valuable recommendations here : 
+You may find more valuable recommendations here :
 
 * https://www.elastic.co/blog/found-elasticsearch-security[https://www.elastic.co/blog/found-elasticsearch-security]
 * https://www.elastic.co/blog/scripting-security[https://www.elastic.co/blog/scripting-security]
diff --git a/manual/src/main/asciidoc/consent-api.adoc b/manual/src/main/asciidoc/consent-api.adoc
index ee6107d..02657c2 100644
--- a/manual/src/main/asciidoc/consent-api.adoc
+++ b/manual/src/main/asciidoc/consent-api.adoc
@@ -33,7 +33,7 @@
 
 [source]
 ----
-curl -X POST http://localhost:8181/context.json?sessionId=1234 \
+curl -X POST http://localhost:8181/cxs/context.json?sessionId=1234 \
 -H "Content-Type: application/json" \
 -d @- <<'EOF'
 {
@@ -77,7 +77,7 @@
 ==== Consent type definitions
 
 Apache Unomi does not manage consent definitions, it leaves that to an external system (for example a CMS) so that it
-can handle user-facing UIs to create, update, internationalize and present consent definitions to end users. 
+can handle user-facing UIs to create, update, internationalize and present consent definitions to end users.
 
 The only thing that is import to Apache Unomi to manage visitor consents is a globally unique key, that is called the
 consent type.
@@ -124,7 +124,7 @@
 
 [source]
 ----
-curl -X POST http://localhost:8181/context.json?sessionId=1234 \
+curl -X POST http://localhost:8181/cxs/context.json?sessionId=1234 \
 -H "Content-Type: application/json" \
 -d @- <<'EOF'
 {
@@ -195,4 +195,4 @@
 As we can see this rule is pretty simple it will simply execute the modifyConsentAction that is implemented by the
 https://github.com/apache/unomi/blob/9f1bab437fd93826dc54d318ed00d3b2e3161437/plugins/baseplugin/src/main/java/org/apache/unomi/plugins/baseplugin/actions/ModifyConsentAction.java[ModifyConsentAction Java class]
 
-This class will update the current visitor profile to add/update/revoke any consents that are included in the event.
\ No newline at end of file
+This class will update the current visitor profile to add/update/revoke any consents that are included in the event.
diff --git a/manual/src/main/asciidoc/getting-started.adoc b/manual/src/main/asciidoc/getting-started.adoc
index 52f5d0c..4c67232 100644
--- a/manual/src/main/asciidoc/getting-started.adoc
+++ b/manual/src/main/asciidoc/getting-started.adoc
@@ -61,10 +61,10 @@
 ----
 
 This indicates that all the Unomi services are started and ready to react to requests. You can then open a browser and go to `http://localhost:8181/cxs` to see the list of
-available RESTful services or retrieve an initial context at `http://localhost:8181/context.json` (which isn't very useful at this point).
+available RESTful services or retrieve an initial context at `http://localhost:8181/cxs/context.json` (which isn't very useful at this point).
 
 You can now find an introduction page at the following location: http://localhost:8181
 
 Also now that your service is up and running you can go look at the
 <<Request examples,request examples>> to learn basic
-requests you can do once your server is up and running.
\ No newline at end of file
+requests you can do once your server is up and running.
diff --git a/manual/src/main/asciidoc/how-profile-tracking-works.adoc b/manual/src/main/asciidoc/how-profile-tracking-works.adoc
index 1a5790f..0296dd3 100644
--- a/manual/src/main/asciidoc/how-profile-tracking-works.adoc
+++ b/manual/src/main/asciidoc/how-profile-tracking-works.adoc
@@ -19,7 +19,7 @@
 
 1. A visitor comes to a website
 2. The web server resolves a previous request session ID if it exists, or if it doesn't it create a new sessionID
-3. A request to Apache Unomi's /context.json servlet is made passing the web server session ID as a query parameter
+3. A request to Apache Unomi's /cxs/context.json servlet is made passing the web server session ID as a query parameter
 4. Unomi uses the sessionID and tries to load an existing session, if none is found a new session is created with the
 ID passed by the web server
 5. If a session was found, the profile ID is extracted from the session and if it not found, Unomi looks for a cookie
diff --git a/manual/src/main/asciidoc/migrations/migrations.adoc b/manual/src/main/asciidoc/migrations/migrations.adoc
index 03f18fc..00c3dfb 100644
--- a/manual/src/main/asciidoc/migrations/migrations.adoc
+++ b/manual/src/main/asciidoc/migrations/migrations.adoc
@@ -18,3 +18,20 @@
 === From version 1.4 to 1.5
 
 include::migrate-1.4-to-1.5.adoc[]
+
+=== Important changes in public servlets since version 1.5.5 and 2.0.0
+What used to be dedicated servlets are now part of the REST endpoints.
+Prior to version 1.5.5 the following servlets were used:
+
+* /context.js /context.json
+* /eventcollector
+* /client
+
+In version 2.0.0 and 1.5.5 and later you have to use the new `cxs` REST endpoints:
+
+* /cxs/context.js /cxs/context.json
+* /cxs/eventcollector
+* /cxs/client
+
+The old servlets have been deprecated and will be removed in a future major version, so make sure
+to update your client applications.
diff --git a/manual/src/main/asciidoc/privacy.adoc b/manual/src/main/asciidoc/privacy.adoc
index c42842a..530af94 100644
--- a/manual/src/main/asciidoc/privacy.adoc
+++ b/manual/src/main/asciidoc/privacy.adoc
@@ -55,7 +55,7 @@
 
 [source]
 ----
-curl -X GET http://localhost:8181/client/myprofile.[json,csv,yaml,text] \
+curl -X GET http://localhost:8181/cxs/client/myprofile.[json,csv,yaml,text] \
 --cookie "context-profile-id=PROFILE-ID"
 ----
 
diff --git a/manual/src/main/asciidoc/recipes.adoc b/manual/src/main/asciidoc/recipes.adoc
index 165c8b7..f8bf2db 100644
--- a/manual/src/main/asciidoc/recipes.adoc
+++ b/manual/src/main/asciidoc/recipes.adoc
@@ -20,14 +20,14 @@
 
 ==== How to read a profile
 
-The simplest way to retrieve profile data for the current profile is to simply send a request to the /context.json
+The simplest way to retrieve profile data for the current profile is to simply send a request to the /cxs/context.json
 endpoint. However you will need to send a body along with that request. Here's an example:
 
 Here is an example that will retrieve all the session and profile properties.
 
 [source]
 ----
-curl -X POST http://localhost:8181/context.json?sessionId=1234 \
+curl -X POST http://localhost:8181/cxs/context.json?sessionId=1234 \
 -H "Content-Type: application/json" \
 -d @- <<'EOF'
 {
@@ -49,7 +49,7 @@
 Java class.
 
 Note that it is also possible to access a profile's data through the /cxs/profiles/ endpoint but that really should be
-reserved to administrative purposes. All public accesses should always use the /context.json endpoint for consistency
+reserved to administrative purposes. All public accesses should always use the /cxs/context.json endpoint for consistency
 and security.
 
 ==== How to update a profile from the public internet
@@ -149,7 +149,7 @@
 
 [source]
 ----
-curl -X POST http://localhost:8181/eventcollector \
+curl -X POST http://localhost:8181/cxs/eventcollector \
 -H "Content-Type: application/json" \
 -d @- <<'EOF'
 {
diff --git a/manual/src/main/asciidoc/request-examples.adoc b/manual/src/main/asciidoc/request-examples.adoc
index 49fba3f..33928cf 100644
--- a/manual/src/main/asciidoc/request-examples.adoc
+++ b/manual/src/main/asciidoc/request-examples.adoc
@@ -19,7 +19,7 @@
 
 [source]
 ----
-curl http://localhost:8181/context.js?sessionId=1234
+curl http://localhost:8181/cxs/context.js?sessionId=1234
 ----
 
 This will retrieve a JavaScript script that contains a `cxs` object that contains the context with the current user
@@ -32,7 +32,7 @@
 
 [source]
 ----
-curl http://localhost:8181/context.json?sessionId=1234
+curl http://localhost:8181/cxs/context.json?sessionId=1234
 ----
 
 ==== Accessing profile properties in a context
@@ -45,7 +45,7 @@
 
 [source]
 ----
-curl -X POST http://localhost:8181/context.json?sessionId=1234 \
+curl -X POST http://localhost:8181/cxs/context.json?sessionId=1234 \
 -H "Content-Type: application/json" \
 -d @- <<'EOF'
 {
@@ -73,7 +73,7 @@
 
 [source]
 ----
-curl -X POST http://localhost:8181/context.json?sessionId=1234 \
+curl -X POST http://localhost:8181/cxs/context.json?sessionId=1234 \
 -H "Content-Type: application/json" \
 -d @- <<'EOF'
 {
@@ -119,7 +119,7 @@
 
 [source]
 ----
-curl -X POST http://localhost:8181/eventcollector \
+curl -X POST http://localhost:8181/cxs/eventcollector \
 -H "Content-Type: application/json" \
 -d @- <<'EOF'
 {
@@ -156,4 +156,4 @@
 
 * You can find more <<Useful Apache Unomi URLs,useful Apache Unomi URLs>> that can be used in the same way as the above examples.
 * You may want to know integrate the provided <<Web Tracker,web tracker>> into your web site.
-* Read the <<Twitter sample,Twitter sample>> documentation that contains a detailed example of how to integrate with Apache Unomi.
\ No newline at end of file
+* Read the <<Twitter sample,Twitter sample>> documentation that contains a detailed example of how to integrate with Apache Unomi.
diff --git a/manual/src/main/asciidoc/samples/twitter-sample.adoc b/manual/src/main/asciidoc/samples/twitter-sample.adoc
index e1ab503..16f8255 100644
--- a/manual/src/main/asciidoc/samples/twitter-sample.adoc
+++ b/manual/src/main/asciidoc/samples/twitter-sample.adoc
@@ -63,7 +63,7 @@
 
 ==== Retrieving context information from Unomi using the context servlet
 
-Unomi provides two ways to retrieve context: either as a pure JSON object containing strictly context information or as a couple of JSON objects augmented with javascript functions that can be used to interact with the Unomi server using the `&lt;context server base URL&gt;/context.json` or `&lt;context server base URL&gt;/context.js` URLs, respectively.
+Unomi provides two ways to retrieve context: either as a pure JSON object containing strictly context information or as a couple of JSON objects augmented with javascript functions that can be used to interact with the Unomi server using the `&lt;context server base URL&gt;/cxs/context.json` or `&lt;context server base URL&gt;/context.js` URLs, respectively.
 
 Below is an example of asynchronously loading the initial context using the javascript version, assuming a default Unomi install running on `http://localhost:8181`:
 
@@ -75,7 +75,7 @@
     if (document.getElementById(id)) return;
     js = document.createElement(elementToCreate);
     js.id = id;
-    js.src = 'http://localhost:8181/context.js';
+    js.src = 'http://localhost:8181/cxs/context.js';
     fjs.parentNode.insertBefore(js, fjs);
 }(document, 'script', 'context'));
 
@@ -122,7 +122,7 @@
     var data = JSON.stringify(payload);
     // if we don't already have a session id, generate one
     var sessionId = cxs.sessionId || generateUUID();
-    var url = 'http://localhost:8181/context.json?sessionId=' + sessionId;
+    var url = 'http://localhost:8181/cxs/context.json?sessionId=' + sessionId;
     var xhr = new XMLHttpRequest();
     var isGet = data.length < 100;
     if (isGet) {
@@ -166,7 +166,7 @@
 * If we specify a payload, it is expected to use the JSON format so we `stringify` it and encode it if passed as a URL parameter in a `GET` request.
 * We need to make a https://developer.mozilla.org/en-US/docs/Web/HTTP/Access_control_CORS[`CORS`] request since the Unomi server is most likely not running on the same host than the one from which the request originates. The specific details are fairly standard and we will not explain them here.
 * We need to either retrieve (from the initial context we retrieved previously using `cxs.sessionId`) or generate a session identifier for our request since Unomi currently requires one.
-* We're calling the `ContextServlet` using the default install URI, specifying the session identifier: `http://localhost:8181/context.json?sessionId=&#39; + sessionId`. This URI requests context from Unomi, resulting in an updated `cxs` object in the javascript global scope. The context server can reply to this request either by returning a JSON-only object containing solely the context information as is the case when the requested URI is `context.json`. However, if the client requests `context.js` then useful functions to interact with Unomi are added to the `cxs` object in addition to the context information as depicted above.
+* We're calling the `ContextServlet` using the default install URI, specifying the session identifier: `http://localhost:8181/cxs/context.json?sessionId=&#39; + sessionId`. This URI requests context from Unomi, resulting in an updated `cxs` object in the javascript global scope. The context server can reply to this request either by returning a JSON-only object containing solely the context information as is the case when the requested URI is `context.json`. However, if the client requests `context.js` then useful functions to interact with Unomi are added to the `cxs` object in addition to the context information as depicted above.
 * We don't need to provide any authentication at all to interact with this part of Unomi since we only have access to read-only data (as well as providing events as we shall see later on). If we had been using the REST API, we would have needed to provide authentication information as well.
 
 ===== Context request and response structure
@@ -212,7 +212,7 @@
 
 [source]
 ----
-curl --location --request POST 'http://localhost:8181/context.json' \
+curl --location --request POST 'http://localhost:8181/cxs/context.json' \
 --header 'Content-Type: application/json' \
 --header 'Cookie: JSESSIONID=48C8AFB3E18B8E3C93C2F4D5B7BD43B7; context-profile-id=01060c4c-a055-4c8f-9692-8a699d0c434a' \
 --data-raw '{
@@ -281,7 +281,7 @@
 
 [source]
 ----
-curl --location --request POST 'http://localhost:8181/context.json' \
+curl --location --request POST 'http://localhost:8181/cxs/context.json' \
 --header 'Content-Type: application/json' \
 --header 'Cookie: JSESSIONID=48C8AFB3E18B8E3C93C2F4D5B7BD43B7; context-profile-id=01060c4c-a055-4c8f-9692-8a699d0c434a' \
 --data-raw '{
diff --git a/manual/src/main/asciidoc/updating-events.adoc b/manual/src/main/asciidoc/updating-events.adoc
index 84a3909..7e2d52f 100644
--- a/manual/src/main/asciidoc/updating-events.adoc
+++ b/manual/src/main/asciidoc/updating-events.adoc
@@ -28,7 +28,7 @@
 
 [source]
 ----
-curl -X POST http://localhost:8181/context.json \
+curl -X POST http://localhost:8181/cxs/context.json \
 -H "Content-Type: application/json" \
 -d @- <<'EOF'
 {
@@ -54,7 +54,7 @@
 
 [source]
 ----
-curl -X POST http://localhost:8181/context.json \
+curl -X POST http://localhost:8181/cxs/context.json \
 -H "Content-Type: application/json" \
 -d @- <<'EOF'
 {
@@ -82,4 +82,4 @@
   ]
 }
 EOF
-----
\ No newline at end of file
+----
diff --git a/performance-tests/src/test/java/org/apache/unomi/performancetests/BasicTest.java b/performance-tests/src/test/java/org/apache/unomi/performancetests/BasicTest.java
index ceda53b..59d4dd3 100644
--- a/performance-tests/src/test/java/org/apache/unomi/performancetests/BasicTest.java
+++ b/performance-tests/src/test/java/org/apache/unomi/performancetests/BasicTest.java
@@ -156,7 +156,7 @@
     public void testContext() throws IOException {
 
         CloseableHttpClient httpclient = HttpClients.createDefault();
-        HttpGet httpGet = new HttpGet("http://localhost:8181/context.js");
+        HttpGet httpGet = new HttpGet("http://localhost:8181/cxs/context.js");
         CloseableHttpResponse response = httpclient.execute(httpGet);
         // The underlying HTTP connection is still held by the response object
         // to allow the response content to be streamed directly from the network socket.
diff --git a/performance-tests/src/test/scala/unomi/PrepareIndices.scala b/performance-tests/src/test/scala/unomi/PrepareIndices.scala
index 1d819cb..045b5b8 100644
--- a/performance-tests/src/test/scala/unomi/PrepareIndices.scala
+++ b/performance-tests/src/test/scala/unomi/PrepareIndices.scala
@@ -57,7 +57,7 @@
     )
   }
 
-  val loadContext = feed(seqSessionsFeed).feed(urllistFeed).exec(http("LoadContext").post("/context.js?sessionId=${sessionId}&timestamp=${timestamp}")
+  val loadContext = feed(seqSessionsFeed).feed(urllistFeed).exec(http("LoadContext").post("/cxs/context.js?sessionId=${sessionId}&timestamp=${timestamp}")
     .headers(headers)
     .body(ELFileBody("ContextLoad_request_0.json")))
 
diff --git a/performance-tests/src/test/scala/unomi/UserScenario.scala b/performance-tests/src/test/scala/unomi/UserScenario.scala
index f88548b..35138df 100644
--- a/performance-tests/src/test/scala/unomi/UserScenario.scala
+++ b/performance-tests/src/test/scala/unomi/UserScenario.scala
@@ -96,23 +96,23 @@
 
   // Browsing requests and scenario
 
-  val loadContext = feed(requestsFeed).feed(urllistFeed).exec(http("LoadContext ${requestTemplate} ${flag}").post("/context.js?sessionId=${sessionId}&timestamp=${timestamp}&remoteAddr=${ip}")
+  val loadContext = feed(requestsFeed).feed(urllistFeed).exec(http("LoadContext ${requestTemplate} ${flag}").post("/cxs/context.js?sessionId=${sessionId}&timestamp=${timestamp}&remoteAddr=${ip}")
     .headers(headers)
     .body(ELFileBody("ContextLoad_request_${requestTemplate}.json")))
     .exec(updatePreviousURL)
     .exec(pauseAndUpdateTimestamp)
 
-  val userLogin = feed(requestsFeed).exec(http("UserLogin").post("/eventcollector?sessionId=${sessionId}&timestamp=${timestamp}&remoteAddr=${ip}")
+  val userLogin = feed(requestsFeed).exec(http("UserLogin").post("/cxs/eventcollector?sessionId=${sessionId}&timestamp=${timestamp}&remoteAddr=${ip}")
     .headers(headers)
     .body(ELFileBody("UserLogin_request.json")))
     .exec(pauseAndUpdateTimestamp)
 
-  val formEvent = feed(requestsFeed).exec(http("Form").post("/eventcollector?sessionId=${sessionId}&timestamp=${timestamp}&remoteAddr=${ip}")
+  val formEvent = feed(requestsFeed).exec(http("Form").post("/cxs/eventcollector?sessionId=${sessionId}&timestamp=${timestamp}&remoteAddr=${ip}")
     .headers(headers)
     .body(ELFileBody("Form_request.json")))
     .exec(pauseAndUpdateTimestamp)
 
-  val searchEvent = feed(requestsFeed).feed(wordsFeed).exec(http("Search").post("/eventcollector?sessionId=${sessionId}&timestamp=${timestamp}&remoteAddr=${ip}")
+  val searchEvent = feed(requestsFeed).feed(wordsFeed).exec(http("Search").post("/cxs/eventcollector?sessionId=${sessionId}&timestamp=${timestamp}&remoteAddr=${ip}")
     .headers(headers)
     .body(ELFileBody("Search_request.json")))
     .exec(pauseAndUpdateTimestamp)
@@ -135,7 +135,7 @@
         .exec(flushSessionCookies)
     }
       .exec(flushCookieJar);
-  
+
   val scn = scenario("User").during(Parameters.totalTime) {
     scnRun
   }
diff --git a/samples/login-integration/src/main/webapp/javascript/login-example.js b/samples/login-integration/src/main/webapp/javascript/login-example.js
index a28ac59..0ccdcc3 100644
--- a/samples/login-integration/src/main/webapp/javascript/login-example.js
+++ b/samples/login-integration/src/main/webapp/javascript/login-example.js
@@ -116,7 +116,7 @@
             // now let's perform the actual call to Apache Unomi, asking it to process the events and give us back the updated (or created) profile.
             // as we have a rule listening to a login event, it will be executed and its actions will be processed.
             $.ajax({
-                url: "http://localhost:8181/context.json?sessionId=" + unomiSessionId,
+                url: "http://localhost:8181/cxs/context.json?sessionId=" + unomiSessionId,
                 type: 'POST',
                 data: JSON.stringify(contextRequest), // make sure you sent JSON and not form-encoded, otherwise Unomi will generate an error
                 contentType: 'application/json; charset=utf-8',
diff --git a/samples/tweet-button-plugin/src/main/webapp/index.html b/samples/tweet-button-plugin/src/main/webapp/index.html
index 791d4dd..244ae43 100644
--- a/samples/tweet-button-plugin/src/main/webapp/index.html
+++ b/samples/tweet-button-plugin/src/main/webapp/index.html
@@ -43,7 +43,7 @@
             if (document.getElementById(id)) return;
             js = document.createElement(elementToCreate);
             js.id = id;
-            js.src = "http://localhost:8181/context.js";
+            js.src = "http://localhost:8181/cxs/context.js";
             fjs.parentNode.insertBefore(js, fjs);
         }(document, 'script', 'context'));
 
@@ -79,7 +79,7 @@
                         sessionId = generateUUID();
                     }
 
-                    var url = 'http://localhost:8181/context.json?sessionId=' + sessionId;
+                    var url = 'http://localhost:8181/cxs/context.json?sessionId=' + sessionId;
                     var xhr = new XMLHttpRequest();
                     var isGet = data.length < 100;
                     if (isGet) {
@@ -178,4 +178,4 @@
     </li>
 </ul>
 </body>
-</html>
\ No newline at end of file
+</html>