SyntaxError: Unexpected token R in JSON at position 0 at JSON.parse (<anonymous>)
<p>Unable to enter success() function instead getting an syntax error of 'Unexpected token R in JSON at position 0 at JSON.parse ()'.
But all the background database operations are going as they should.</p>

<p>Note: I am not returning any JSON data from the AJAX call</p>

<pre><code>&lt;html ng-app="PlaylistApp"&gt;
&lt;head&gt;
&lt;meta charset="utf-8"&gt;
&lt;title&gt;Angular.js Example&lt;/title&gt;
&lt;link rel="stylesheet" type="text/css" href="style.css"&gt;
&lt;script src="lib/angular.min.js"&gt;&lt;/script&gt;
&lt;script&gt;
      var playlistApp = angular.module('PlaylistApp', []);
      playlistApp.controller('PlaylistCtrl', function ($scope, $http)
      {
            $http({
                    method : 'GET',
                    url : 'http://localhost:8080/SignageSoC/api/playlist/all'
                    }).then(function success(response) {
                    $scope.playlists = response.data;
                });
          $scope.removePlaylist = function(index, playlistId)
          {       
            var i = index;
            alert(i);
            alert(playlistId);
            $http({
                    method : 'DELETE',
                    url : 'http://localhost:8080/SignageSoC/api/playlist/'+ playlistId
                 }).then(function success() {
                    alert(i);
                    $scope.playlists.splice(i, 1);
                });
            }
    });
&lt;/script&gt;
&lt;/head&gt;
&lt;body ng-controller="PlaylistCtrl"&gt;
    &lt;div&gt;
        &lt;br&gt;
        &lt;br&gt;
        &lt;br&gt;
        &lt;table class="center"&gt;
            &lt;tr&gt;
                &lt;th&gt;PlaylistId&lt;/th&gt;
                &lt;th&gt;Name&lt;/th&gt;
                &lt;th&gt;Total_duration&lt;/th&gt;
                &lt;th&gt;Play_continuous&lt;/th&gt;
                &lt;th&gt;Start_time&lt;/th&gt;
                &lt;th&gt;End_time&lt;/th&gt;
                &lt;th&gt;Update&lt;/th&gt;
                &lt;th&gt;Remove&lt;/th&gt;
            &lt;/tr&gt;
            &lt;tr data-ng-repeat="(index,x) in playlists"&gt;
                &lt;td&gt;{{x.playlistId}}&lt;/td&gt;
                &lt;td&gt;{{x.name}}&lt;/td&gt;
                &lt;td&gt;{{x.total_duration}}&lt;/td&gt;
                &lt;td&gt;{{x.play_continuous}}&lt;/td&gt;
                &lt;td&gt;{{x.start_time}}&lt;/td&gt;
                &lt;td&gt;{{x.end_time}}&lt;/td&gt;
                &lt;td&gt;&lt;button data-ng-click="updatePlaylist(index)"&gt;Update&lt;/button&gt;&lt;/td&gt;
                &lt;td&gt;&lt;button data-ng-click="removePlaylist(index, x.playlistId)"&gt;Delete&lt;/button&gt;&lt;/td&gt;
            &lt;/tr&gt;
        &lt;/table&gt;
    &lt;/div&gt;
&lt;/body&gt;
&lt;/html&gt;
</code></pre>