diff --git a/examples/chat_html_root/favicon.ico b/examples/chat_server/web_root/favicon.ico
similarity index 100%
rename from examples/chat_html_root/favicon.ico
rename to examples/chat_server/web_root/favicon.ico
diff --git a/examples/chat_html_root/index.html b/examples/chat_server/web_root/index.html
similarity index 100%
rename from examples/chat_html_root/index.html
rename to examples/chat_server/web_root/index.html
diff --git a/examples/chat_html_root/jquery.js b/examples/chat_server/web_root/jquery.js
similarity index 100%
rename from examples/chat_html_root/jquery.js
rename to examples/chat_server/web_root/jquery.js
diff --git a/examples/chat_html_root/login.html b/examples/chat_server/web_root/login.html
similarity index 100%
rename from examples/chat_html_root/login.html
rename to examples/chat_server/web_root/login.html
diff --git a/examples/chat_html_root/logo.png b/examples/chat_server/web_root/logo.png
similarity index 100%
rename from examples/chat_html_root/logo.png
rename to examples/chat_server/web_root/logo.png
diff --git a/examples/chat_html_root/main.js b/examples/chat_server/web_root/main.js
similarity index 92%
rename from examples/chat_html_root/main.js
rename to examples/chat_server/web_root/main.js
index 6204d1ad18be35dabf50c393f9aa6d13665ba11b..00c3e63f024ba8ddf0559cc36f1649e24b7b6a31 100644
--- a/examples/chat_html_root/main.js
+++ b/examples/chat_server/web_root/main.js
@@ -3,7 +3,7 @@
 var chat = {
   // Backend URL, string.
   // 'http://backend.address.com' or '' if backend is the same as frontend
-  backendUrl: '',
+  backendUrl: 'api.lp',
   maxVisibleMessages: 10,
   errorMessageFadeOutTimeoutMs: 2000,
   errorMessageFadeOutTimer: null,
@@ -20,7 +20,7 @@ chat.refresh = function(data) {
   if (data === undefined) {
     return;
   }
-  
+
   $.each(data, function(index, entry) {
     var row = $('<div>').addClass('message-row').appendTo('#mml');
     var timestamp = (new Date(entry.timestamp * 1000)).toLocaleTimeString();
@@ -49,9 +49,7 @@ chat.refresh = function(data) {
 
 chat.getMessages = function(enter_loop) {
   $.ajax({
-    dataType: 'jsonp',
-    url: chat.backendUrl + '/ajax/get_messages',
-    data: {last_id: chat.lastMessageId},
+    data: {last_id: chat.lastMessageId, cmd: 'get_messages'},
     success: chat.refresh,
     error: function() {
     },
@@ -82,9 +80,7 @@ chat.handleMessageInput = function(ev) {
     return;
   //input.disabled = true;
   $.ajax({
-    dataType: 'jsonp',
-    url: chat.backendUrl + '/ajax/send_message',
-    data: {text: input.value},
+    data: { text: input.value, cmd: 'send_message' },
     success: function(ev) {
       input.value = '';
       input.disabled = false;
@@ -98,6 +94,10 @@ chat.handleMessageInput = function(ev) {
 };
 
 $(document).ready(function() {
+  $.ajaxSetup({
+    dataType: 'json',
+    url: chat.backendUrl
+  });
   $('.menu-item').click(chat.handleMenuItemClick);
   $('.message-input').keypress(chat.handleMessageInput);
   chat.getMessages(true);
diff --git a/examples/chat_html_root/style.css b/examples/chat_server/web_root/style.css
similarity index 100%
rename from examples/chat_html_root/style.css
rename to examples/chat_server/web_root/style.css