public HttpResponseMessage GetSettings()
        {
            var moduleId = Request.FindModuleId();
            var tabId = Request.FindTabId();

            Log.DebugFormat("Getting settings for moduleId:{0}, tabId:{1}",
                                moduleId,
                                tabId);

            var viewModel = new SettingsModel(new ShoutBoxModuleSettings(moduleId, tabId));

            Log.Debug(viewModel);

            var response = new
            {
                success = true,
                data = new
                {
                    results = viewModel,
                    oldShoutsCount = _repository.CountOldShouts(moduleId, 30)
                }
            };

            return this.Request.CreateResponse(response);
        }
        public HttpResponseMessage SaveSettings(SettingsModel settings)
        {
            var moduleSettings = new ShoutBoxModuleSettings(Request.FindModuleId(), 
                                                              Request.FindTabId());

            moduleSettings.AllowAnonymous = settings.AllowAnonymous;
            moduleSettings.FloodNewPost = settings.FloodNewPost;
            moduleSettings.FloodReply = settings.FloodReply;
            moduleSettings.FloodVoting = settings.FloodVoting;
            moduleSettings.ProfileImageSource = settings.ProfileImageSource;
            moduleSettings.NumberOfPostsToReturn = settings.RecordLimit;

            var response = new
            {
                success = true
            };

            return Request.CreateResponse(response);
        }