Commits

lfoust committed 8bb745b

Removed Response Classes. Refactored PagedList and IResponse<T> became IPayload<T>

Comments (0)

Files changed (68)

trunk/source/Stacky.Net35/Stacky.Net35.csproj

     <Compile Include="..\Stacky\Enums\UserSort.cs">
       <Link>Enums\UserSort.cs</Link>
     </Compile>
+    <Compile Include="..\Stacky\ErrorResponse.cs">
+      <Link>ErrorResponse.cs</Link>
+    </Compile>
     <Compile Include="..\Stacky\Helpers\DateHelper.cs">
       <Link>Helpers\DateHelper.cs</Link>
     </Compile>
     <Compile Include="..\Stacky\Interfaces\IPagedList.cs">
       <Link>Interfaces\IPagedList.cs</Link>
     </Compile>
+    <Compile Include="..\Stacky\Interfaces\IPayload.cs">
+      <Link>Interfaces\IPayload.cs</Link>
+    </Compile>
     <Compile Include="..\Stacky\Interfaces\IProtocol.cs">
       <Link>Interfaces\IProtocol.cs</Link>
     </Compile>
-    <Compile Include="..\Stacky\Interfaces\IResponse.cs">
-      <Link>Interfaces\IResponse.cs</Link>
-    </Compile>
     <Compile Include="..\Stacky\Interfaces\IUrlClient.cs">
       <Link>Interfaces\IUrlClient.cs</Link>
     </Compile>
     <Compile Include="..\Stacky\PagedList.cs">
       <Link>PagedList.cs</Link>
     </Compile>
+    <Compile Include="..\Stacky\Protocols\JsonPayload.cs">
+      <Link>Protocols\JsonPayload.cs</Link>
+    </Compile>
     <Compile Include="..\Stacky\Protocols\JsonProtocol.cs">
       <Link>Protocols\JsonProtocol.cs</Link>
     </Compile>
-    <Compile Include="..\Stacky\Protocols\JsonResponse.cs">
-      <Link>Protocols\JsonResponse.cs</Link>
-    </Compile>
-    <Compile Include="..\Stacky\Responses\AnswerResponse.cs">
-      <Link>Responses\AnswerResponse.cs</Link>
-    </Compile>
-    <Compile Include="..\Stacky\Responses\AssociatedUsersResponse.cs">
-      <Link>Responses\AssociatedUsersResponse.cs</Link>
-    </Compile>
-    <Compile Include="..\Stacky\Responses\BadgeResponse.cs">
-      <Link>Responses\BadgeResponse.cs</Link>
-    </Compile>
-    <Compile Include="..\Stacky\Responses\CommentResponse.cs">
-      <Link>Responses\CommentResponse.cs</Link>
-    </Compile>
-    <Compile Include="..\Stacky\Responses\ErrorResponse.cs">
-      <Link>Responses\ErrorResponse.cs</Link>
-    </Compile>
-    <Compile Include="..\Stacky\Responses\PrivilegeResponse.cs">
-      <Link>Responses\PrivilegeResponse.cs</Link>
-    </Compile>
-    <Compile Include="..\Stacky\Responses\QuestionResponse.cs">
-      <Link>Responses\QuestionResponse.cs</Link>
-    </Compile>
-    <Compile Include="..\Stacky\Responses\QuestionTimelineResponse.cs">
-      <Link>Responses\QuestionTimelineResponse.cs</Link>
-    </Compile>
-    <Compile Include="..\Stacky\Responses\ReputationResponse.cs">
-      <Link>Responses\ReputationResponse.cs</Link>
-    </Compile>
-    <Compile Include="..\Stacky\Responses\Response.cs">
-      <Link>Responses\Response.cs</Link>
-    </Compile>
-    <Compile Include="..\Stacky\Responses\RevisionResponse.cs">
-      <Link>Responses\RevisionResponse.cs</Link>
-    </Compile>
-    <Compile Include="..\Stacky\Responses\SitesResponse.cs">
-      <Link>Responses\SitesResponse.cs</Link>
-    </Compile>
-    <Compile Include="..\Stacky\Responses\StatsResponse.cs">
-      <Link>Responses\StatsResponse.cs</Link>
-    </Compile>
-    <Compile Include="..\Stacky\Responses\TagResponse.cs">
-      <Link>Responses\TagResponse.cs</Link>
-    </Compile>
-    <Compile Include="..\Stacky\Responses\TagSynonymResponse.cs">
-      <Link>Responses\TagSynonymResponse.cs</Link>
-    </Compile>
-    <Compile Include="..\Stacky\Responses\TagWikiResponse.cs">
-      <Link>Responses\TagWikiResponse.cs</Link>
-    </Compile>
-    <Compile Include="..\Stacky\Responses\TopTagResponse.cs">
-      <Link>Responses\TopTagResponse.cs</Link>
-    </Compile>
-    <Compile Include="..\Stacky\Responses\TopUserResponse.cs">
-      <Link>Responses\TopUserResponse.cs</Link>
-    </Compile>
-    <Compile Include="..\Stacky\Responses\UserEventResponse.cs">
-      <Link>Responses\UserEventResponse.cs</Link>
-    </Compile>
-    <Compile Include="..\Stacky\Responses\UserResponse.cs">
-      <Link>Responses\UserResponse.cs</Link>
+    <Compile Include="..\Stacky\Response.cs">
+      <Link>Response.cs</Link>
     </Compile>
     <Compile Include="..\Stacky\Sites.cs">
       <Link>Sites.cs</Link>

trunk/source/Stacky.Net35/StackyClient/AnswerMethods.cs

 
         public virtual IPagedList<Answer> GetUsersAnswers(IEnumerable<int> userIds, AnswerOptions options)
         {
-            var response = MakeRequest<AnswerResponse>("users", new string[] { userIds.Vectorize(), "answers" }, new
+            var response = MakeRequest<Answer>("users", new string[] { userIds.Vectorize(), "answers" }, new
             {
                 site = this.SiteUrlName,
                 page = options.Page ?? null,
                 fromdate = options.FromDate.HasValue ? (long?)options.FromDate.Value.ToUnixTime() : null,
                 todate = options.ToDate.HasValue ? (long?)options.ToDate.Value.ToUnixTime() : null
             });
-            return new PagedList<Answer>(response.Answers, response);
+            return new PagedList<Answer>(response);
         }
 
         public virtual IPagedList<Answer> GetQuestionAnswers(IEnumerable<int> questionIds)
 
         public virtual IPagedList<Answer> GetQuestionAnswers(IEnumerable<int> questionIds, AnswerOptions options)
         {
-            var response = MakeRequest<AnswerResponse>("questions", new string[] { questionIds.Vectorize(), "answers" }, new
+            var response = MakeRequest<Answer>("questions", new string[] { questionIds.Vectorize(), "answers" }, new
             {
                 site = this.SiteUrlName,
                 page = options.Page ?? null,
                 fromdate = options.FromDate.HasValue ? (long?)options.FromDate.Value.ToUnixTime() : null,
                 todate = options.ToDate.HasValue ? (long?)options.ToDate.Value.ToUnixTime() : null
             });
-            return new PagedList<Answer>(response.Answers, response);
+            return new PagedList<Answer>(response);
         }
 
         public virtual IPagedList<Answer> GetQuestionAnswers(int questionId)
 
         public virtual IPagedList<Answer> GetAnswers(IEnumerable<int> answerIds, AnswerOptions options)
         {
-            var response = MakeRequest<AnswerResponse>("answers", new string[] { answerIds.Vectorize() }, new
+            var response = MakeRequest<Answer>("answers", new string[] { answerIds.Vectorize() }, new
             {
                 site = this.SiteUrlName,
                 page = options.Page ?? null,
                 fromdate = options.FromDate.HasValue ? (long?)options.FromDate.Value.ToUnixTime() : null,
                 todate = options.ToDate.HasValue ? (long?)options.ToDate.Value.ToUnixTime() : null
             });
-            return new PagedList<Answer>(response.Answers, response);
+            return new PagedList<Answer>(response);
         }
     }
 }

trunk/source/Stacky.Net35/StackyClient/BadgeMethods.cs

 
         private IEnumerable<Badge> GetBadges(string method, string[] urlArguments)
         {
-            return MakeRequest<BadgeResponse>(method, urlArguments, new
+            return MakeRequest<Badge>(method, urlArguments, new
             {
                 site = this.SiteUrlName
-            }).Badges;
+            }).Items;
         }
 
         public virtual IEnumerable<User> GetUsersByBadge(int badgeId)
 
         public virtual IPagedList<User> GetUsersByBadge(IEnumerable<int> badgeIds, BadgeByUserOptions options)
         {
-            var response = MakeRequest<UserResponse>("badges", new string[] { badgeIds.Vectorize() }, new
+            var response = MakeRequest<User>("badges", new string[] { badgeIds.Vectorize() }, new
             {
                 site = this.SiteUrlName,
                 page = options.Page ?? null,
                 fromdate = options.FromDate.HasValue ? (long?)options.FromDate.Value.ToUnixTime() : null,
                 todate = options.ToDate.HasValue ? (long?)options.ToDate.Value.ToUnixTime() : null
             });
-            return new PagedList<User>(response.Users, response);
+            return new PagedList<User>(response);
         }
 
         public virtual IEnumerable<Badge> GetTagBasedBadges()

trunk/source/Stacky.Net35/StackyClient/CommentMethods.cs

                 urlParameters = new string[] { fromUserIds.Vectorize(), "comments" };
             }
 
-            var response = MakeRequest<CommentResponse>("users", urlParameters, new
+            var response = MakeRequest<Comment>("users", urlParameters, new
             {
                 site = this.SiteUrlName,
                 page = options.Page ?? null,
                 min = options.Min ?? null,
                 max = options.Max ?? null
             });
-            return new PagedList<Comment>(response.Comments, response);
+            return new PagedList<Comment>(response);
         }
 
         public virtual IPagedList<Comment> GetComments(int fromUserId)
 
         public virtual IPagedList<Comment> GetCommentsByPost(IEnumerable<int> postIds, CommentsByPostOptions options)
         {
-            var response = MakeRequest<CommentResponse>("posts", new string[] { postIds.Vectorize(), "comments" }, new
+            var response = MakeRequest<Comment>("posts", new string[] { postIds.Vectorize(), "comments" }, new
             {
                 site = this.SiteUrlName,
                 page = options.Page ?? null,
                 sort = options.SortBy.ToString().ToLower(),
                 order = GetSortDirection(options.SortDirection),
             });
-            return new PagedList<Comment>(response.Comments, response);
+            return new PagedList<Comment>(response);
         }
 
         public virtual IPagedList<Comment> GetAnswerComments(int answerId)
 
         public virtual IPagedList<Comment> GetAnswerComments(IEnumerable<int> answerIds, CommentsByPostOptions options)
         {
-            var response = MakeRequest<CommentResponse>("answers", new string[] { answerIds.Vectorize(), "comments" }, new
+            var response = MakeRequest<Comment>("answers", new string[] { answerIds.Vectorize(), "comments" }, new
             {
                 site = this.SiteUrlName,
                 page = options.Page ?? null,
                 min = options.Min ?? null,
                 max = options.Max ?? null
             });
-            return new PagedList<Comment>(response.Comments, response);
+            return new PagedList<Comment>(response);
         }
     }
 }

trunk/source/Stacky.Net35/StackyClient/QuestionMethods.cs

 
         private IPagedList<Question> GetQuestions(string method, string[] urlArguments, string sort, string sortDirection, int? page, int? pageSize, bool includeBody, bool includeComments, bool includeAnswers, DateTime? fromDate, DateTime? toDate, int? min, int? max, params string[] tags)
         {
-            var response = MakeRequest<QuestionResponse>(method, urlArguments, new
+            var response = MakeRequest<Question>(method, urlArguments, new
             {
                 site = this.SiteUrlName,
                 page = page ?? null,
                 min = min ?? null,
                 max = max ?? null
             });
-            return new PagedList<Question>(response.Questions, response);
+            return new PagedList<Question>(response);
         }
 
         public virtual Question GetQuestion(int questionId)
 
         public virtual IPagedList<PostEvent> GetQuestionTimeline(IEnumerable<int> questionIds, QuestionTimelineOptions options)
         {
-            var response = MakeRequest<QuestionTimelineResponse>("questions", new string[] { questionIds.Vectorize(), "timeline" }, new
+            var response = MakeRequest<PostEvent>("questions", new string[] { questionIds.Vectorize(), "timeline" }, new
             {
                 site = this.SiteUrlName,
                 page = options.Page ?? null,
                 fromdate = options.FromDate.HasValue ? (long?)options.FromDate.Value.ToUnixTime() : null,
                 todate = options.ToDate.HasValue ? (long?)options.ToDate.Value.ToUnixTime() : null
             });
-            return new PagedList<PostEvent>(response.Events, response);
+            return new PagedList<PostEvent>(response);
         }
 
         public virtual IEnumerable<PostEvent> GetQuestionTimeline(int questionId)
             if (options.NotTagged != null)
                 notTaggedString = String.Join(" ", options.NotTagged.ToArray());
 
-            var response = MakeRequest<QuestionResponse>("search", null, new
+            var response = MakeRequest<Question>("search", null, new
             {
                 site = this.SiteUrlName,
                 intitle = options.InTitle,
                 min = options.Min ?? null,
                 max = options.Max ?? null
             });
-            return new PagedList<Question>(response.Questions, response);
+            return new PagedList<Question>(response);
         }
     }
 }

trunk/source/Stacky.Net35/StackyClient/RevisionMethods.cs

 
         public virtual IEnumerable<Revision> GetRevisions(IEnumerable<int> ids, DateTime? fromDate, DateTime? toDate)
         {
-            return MakeRequest<RevisionResponse>("revisions", new string[] { ids.Vectorize() }, new
+            return MakeRequest<Revision>("revisions", new string[] { ids.Vectorize() }, new
             {
                 site = this.SiteUrlName,
                 fromdate = fromDate.HasValue ? (long?)fromDate.Value.ToUnixTime() : null,
                 todate = toDate.HasValue ? (long?)toDate.Value.ToUnixTime() : null
-            }).Revisions;
+            }).Items;
         }
 
         public virtual IEnumerable<Revision> GetRevisions(int id)
 
         public virtual Revision GetRevision(int id, Guid revision)
         {
-            return MakeRequest<RevisionResponse>("revisions", new string[] { id.ToString(), revision.ToString() }, new
+            return MakeRequest<Revision>("revisions", new string[] { id.ToString(), revision.ToString() }, new
             {
                 site = this.SiteUrlName
-            }).Revisions.FirstOrDefault();
+            }).Items.FirstOrDefault();
         }
     }
 }

trunk/source/Stacky.Net35/StackyClient/StatsMethods.cs

     {
         public virtual SiteStats GetSiteStats()
         {
-            return MakeRequest<StatsResponse>("stats", null, new
+            return MakeRequest<SiteStats>("stats", null, new
             {
                 site = this.SiteUrlName
-            }).Statistics.FirstOrDefault();
+            }).Items.FirstOrDefault();
         }
     }
 }

trunk/source/Stacky.Net35/StackyClient/TagMethods.cs

 
         private IPagedList<Tag> GetTags(string method, string[] urlParameters, string filter, string sort, string order, int? page, int? pageSize, DateTime? fromDate, DateTime? toDate, int? min, int? max)
         {
-            var response = MakeRequest<TagResponse>(method, urlParameters, new
+            var response = MakeRequest<Tag>(method, urlParameters, new
             {
                 site = this.SiteUrlName,
                 page = page ?? null,
                 min = min ?? null,
                 max = max ?? null
             });
-            return new PagedList<Tag>(response.Tags, response);
+            return new PagedList<Tag>(response);
         }
 
         public virtual IPagedList<Tag> GetTagsByUser(int userId)

trunk/source/Stacky.Net35/StackyClient/UserMethods.cs

 
         private IPagedList<User> GetUsers(UserOptions options, string[] urlParameters)
         {
-            var response = MakeRequest<UserResponse>("users", urlParameters, new
+            var response = MakeRequest<User>("users", urlParameters, new
             {
                 site = this.SiteUrlName,
                 page = options.Page ?? null,
                 min = options.Min ?? null,
                 max = options.Max ?? null
             });
-            return new PagedList<User>(response.Users, response);
+            return new PagedList<User>(response);
         }
 
         public virtual User GetUser(int userId)
 
         public virtual IPagedList<Comment> GetUserMentions(IEnumerable<int> userIds, UserMentionsOptions options)
         {
-            var response = MakeRequest<CommentResponse>("users", new string[] { userIds.Vectorize(), "mentioned" }, new
+            var response = MakeRequest<Comment>("users", new string[] { userIds.Vectorize(), "mentioned" }, new
             {
                 site = this.SiteUrlName,
                 page = options.Page ?? null,
                 min = options.Min ?? null,
                 max = options.Max ?? null
             });
-            return new PagedList<Comment>(response.Comments, response);
+            return new PagedList<Comment>(response);
         }
 
         public virtual IPagedList<UserEvent> GetUserTimeline(int userId)
 
         public virtual IPagedList<UserEvent> GetUserTimeline(IEnumerable<int> userIds, UserTimelineOptions options)
         {
-            var response = MakeRequest<UserEventResponse>("users", new string[] { userIds.Vectorize(), "timeline" }, new
+            var response = MakeRequest<UserEvent>("users", new string[] { userIds.Vectorize(), "timeline" }, new
             {
                 site = this.SiteUrlName,
                 fromdate = options.FromDate.HasValue ? (long?)options.FromDate.Value.ToUnixTime() : null,
                 page = options.Page ?? null,
                 pagesize = options.PageSize ?? null
             });
-            return new PagedList<UserEvent>(response.Events, response);
+            return new PagedList<UserEvent>(response);
         }
 
         public virtual IPagedList<Reputation> GetUserReputation(int userId)
 
         public virtual IPagedList<Reputation> GetUserReputation(IEnumerable<int> userIds, ReputationOptions options)
         {
-            var response = MakeRequest<ReputationResponse>("users", new string[] { userIds.Vectorize(), "reputation" }, new
+            var response = MakeRequest<Reputation>("users", new string[] { userIds.Vectorize(), "reputation" }, new
             {
                 site = this.SiteUrlName,
                 fromdate = options.FromDate.HasValue ? (long?)options.FromDate.Value.ToUnixTime() : null,
                 page = options.Page ?? null,
                 pagesize = options.PageSize ?? null
             });
-            return new PagedList<Reputation>(response.Reputation, response);
+            return new PagedList<Reputation>(response);
         }
 
         public virtual IPagedList<User> GetModerators()

trunk/source/Stacky.Net35/StackyClientAsync/AnswerMethods.cs

 
         private void GetAnswers(string method, string[] urlParameters, Action<IPagedList<Answer>> onSuccess, Action<ApiException> onError, AnswerOptions options)
         {
-            MakeRequest<AnswerResponse>(method, urlParameters, new
+            MakeRequest<Answer>(method, urlParameters, new
             {
                 site = this.SiteUrlName,
                 page = options.Page ?? null,
                 max = options.Max ?? null,
                 fromdate = options.FromDate.HasValue ? (long?)options.FromDate.Value.ToUnixTime() : null,
                 todate = options.ToDate.HasValue ? (long?)options.ToDate.Value.ToUnixTime() : null
-            }, (items) => onSuccess(new PagedList<Answer>(items.Answers, items)), onError);
+            }, (items) => onSuccess(new PagedList<Answer>(items)), onError);
         }
     }
 }

trunk/source/Stacky.Net35/StackyClientAsync/BadgeMethods.cs

 
         private void GetBadges(Action<IEnumerable<Badge>> onSuccess, Action<ApiException> onError, string method, string[] urlArguments)
         {
-            MakeRequest<BadgeResponse>(method, urlArguments, new
+            MakeRequest<Badge>(method, urlArguments, new
             {
                 site = this.SiteUrlName
-            }, (items) => onSuccess(items.Badges), onError);
+            }, (items) => onSuccess(items.Items), onError);
         }
 
         public virtual void GetUsersByBadge(int userId, Action<IPagedList<User>> onSuccess, Action<ApiException> onError)
 
         public virtual void GetUsersByBadge(IEnumerable<int> userIds, Action<IPagedList<User>> onSuccess, Action<ApiException> onError, BadgeByUserOptions options)
         {
-            MakeRequest<UserResponse>("badges", new string[] { userIds.Vectorize(), "badges" }, new
+            MakeRequest<User>("badges", new string[] { userIds.Vectorize(), "badges" }, new
             {
                 site = this.SiteUrlName,
                 page = options.Page ?? null,
                 pagesize = options.PageSize ?? null,
                 fromdate = options.FromDate.HasValue ? (long?)options.FromDate.Value.ToUnixTime() : null,
                 todate = options.ToDate.HasValue ? (long?)options.ToDate.Value.ToUnixTime() : null
-            }, (items) => onSuccess(new PagedList<User>(items.Users, items)), onError);
+            }, (items) => onSuccess(new PagedList<User>(items)), onError);
         }
 
         public virtual void GetTagBasedBadges(Action<IEnumerable<Badge>> onSuccess, Action<ApiException> onError = null)

trunk/source/Stacky.Net35/StackyClientAsync/CommentMethods.cs

                 urlParameters = new string[] { fromUserIds.Vectorize(), "comments" };
             }
 
-            MakeRequest<CommentResponse>("users", urlParameters, new
+            MakeRequest<Comment>("users", urlParameters, new
             {
                 site = this.SiteUrlName,
                 page = options.Page ?? null,
                 order = GetSortDirection(options.SortDirection),
                 min = options.Min ?? null,
                 max = options.Max ?? null
-            }, (items) => onSuccess(new PagedList<Comment>(items.Comments, items)), onError);
+            }, (items) => onSuccess(new PagedList<Comment>(items)), onError);
         }
 
         public virtual void GetComments(int fromUserId, Action<IPagedList<Comment>> onSuccess, Action<ApiException> onError = null)
 
         public virtual void GetCommentsByPost(IEnumerable<int> postIds, Action<IPagedList<Comment>> onSuccess, Action<ApiException> onError, CommentsByPostOptions options)
         {
-            MakeRequest<CommentResponse>("posts", new string[] { postIds.Vectorize(), "comments" }, new
+            MakeRequest<Comment>("posts", new string[] { postIds.Vectorize(), "comments" }, new
             {
                 site = this.SiteUrlName,
                 page = options.Page ?? null,
                 todate = options.ToDate.HasValue ? (long?)options.ToDate.Value.ToUnixTime() : null,
                 sort = options.SortBy.ToString().ToLower(),
                 order = GetSortDirection(options.SortDirection),
-            }, (items) => onSuccess(new PagedList<Comment>(items.Comments, items)), onError);
+            }, (items) => onSuccess(new PagedList<Comment>(items)), onError);
         }
 
         public virtual void GetAnswerComments(int answerId, Action<IPagedList<Comment>> onSuccess, Action<ApiException> onError = null)
 
         public virtual void GetAnswerComments(IEnumerable<int> answerIds, Action<IPagedList<Comment>> onSuccess, Action<ApiException> onError, CommentsByPostOptions options)
         {
-            MakeRequest<CommentResponse>("answers", new string[] { answerIds.Vectorize(), "comments" }, new
+            MakeRequest<Comment>("answers", new string[] { answerIds.Vectorize(), "comments" }, new
             {
                 site = this.SiteUrlName,
                 page = options.Page ?? null,
                 order = GetSortDirection(options.SortDirection),
                 min = options.Min ?? null,
                 max = options.Max ?? null
-            }, response => onSuccess(new PagedList<Comment>(response.Comments, response)), onError);
+            }, response => onSuccess(new PagedList<Comment>(response)), onError);
         }
     }
 }

trunk/source/Stacky.Net35/StackyClientAsync/QuestionMethods.cs

     {
         private void GetQuestions(Action<IPagedList<Question>> onSuccess, Action<ApiException> onError, string method, string[] urlArgs, string sort, string sortDirection, int? page, int? pageSize, bool includeBody, bool includeComments, bool includeAnswers, DateTime? fromDate, DateTime? toDate, int? min, int? max, params string[] tags)
         {
-            MakeRequest<QuestionResponse>(method, urlArgs, new
+            MakeRequest<Question>(method, urlArgs, new
             {
                 site = this.SiteUrlName,
                 page = page ?? null,
                 order = sortDirection,
                 min = min ?? null,
                 max = max ?? null
-            }, (items) => onSuccess(new PagedList<Question>(items.Questions, items)), onError);
+            }, (items) => onSuccess(new PagedList<Question>(items)), onError);
         }
 
         public virtual void GetQuestions(Action<IPagedList<Question>> onSuccess, Action<ApiException> onError = null)
 
         public virtual void GetQuestionTimeline(IEnumerable<int> questionIds, Action<IPagedList<PostEvent>> onSuccess, Action<ApiException> onError, QuestionTimelineOptions options)
         {
-            MakeRequest<QuestionTimelineResponse>("questions", new string[] { questionIds.Vectorize(), "timeline" }, new
+            MakeRequest<PostEvent>("questions", new string[] { questionIds.Vectorize(), "timeline" }, new
             {
                 site = this.SiteUrlName,
                 page = options.Page ?? null,
                 pagesize = options.PageSize ?? null,
                 fromdate = options.FromDate.HasValue ? (long?)options.FromDate.Value.ToUnixTime() : null,
                 todate = options.ToDate.HasValue ? (long?)options.ToDate.Value.ToUnixTime() : null
-            }, (items) => onSuccess(new PagedList<PostEvent>(items.Events, items)), onError);
+            }, (items) => onSuccess(new PagedList<PostEvent>(items)), onError);
         }
 
         public virtual void GetQuestionTimeline(int questionId, Action<IPagedList<PostEvent>> onSuccess, Action<ApiException> onError)
             if (options.NotTagged != null)
                 notTaggedString = String.Join(" ", options.NotTagged.ToArray());
 
-            MakeRequest<QuestionResponse>("search", null, new
+            MakeRequest<Question>("search", null, new
             {
                 site = this.SiteUrlName,
                 intitle = options.InTitle,
                 pagesize = options.PageSize ?? null,
                 min = options.Min ?? null,
                 max = options.Max ?? null
-            }, (items) => onSuccess(new PagedList<Question>(items.Questions, items)), onError);
+            }, (items) => onSuccess(new PagedList<Question>(items)), onError);
         }
     }
 }

trunk/source/Stacky.Net35/StackyClientAsync/RevisionMethods.cs

 
         public virtual void GetRevisions(IEnumerable<int> ids, Action<IEnumerable<Revision>> onSuccess, Action<ApiException> onError, DateTime? fromDate, DateTime? toDate)
         {
-            MakeRequest<RevisionResponse>("revisions", new string[] { ids.Vectorize() }, new
+            MakeRequest<Revision>("revisions", new string[] { ids.Vectorize() }, new
             {
                 site = this.SiteUrlName,
                 fromdate = fromDate.HasValue ? (long?)fromDate.Value.ToUnixTime() : null,
                 todate = toDate.HasValue ? (long?)toDate.Value.ToUnixTime() : null
-            }, (items) => onSuccess(items.Revisions), onError);
+            }, (items) => onSuccess(items.Items), onError);
         }
 
         public virtual void GetRevisions(int id, Action<IEnumerable<Revision>> onSuccess, Action<ApiException> onError)
 
         public virtual void GetRevision(int id, Guid revision, Action<Revision> onSuccess, Action<ApiException> onError)
         {
-            MakeRequest<RevisionResponse>("revisions", new string[] { id.ToString(), revision.ToString() }, new
+            MakeRequest<Revision>("revisions", new string[] { id.ToString(), revision.ToString() }, new
             {
                 site = this.SiteUrlName
-            }, returnedItems => onSuccess(returnedItems.Revisions.FirstOrDefault()), onError);
+            }, returnedItems => onSuccess(returnedItems.Items.FirstOrDefault()), onError);
         }
     }
 }

trunk/source/Stacky.Net35/StackyClientAsync/StatsMethods.cs

     {
         public virtual void GetSiteStats(Action<SiteStats> onSuccess, Action<ApiException> onError)
         {
-            MakeRequest<StatsResponse>("stats", null, new
+            MakeRequest<SiteStats>("stats", null, new
             {
                 site = this.SiteUrlName
-            }, results => onSuccess(results.Statistics.FirstOrDefault()), onError);
+            }, results => onSuccess(results.Items.FirstOrDefault()), onError);
         }
     }
 }

trunk/source/Stacky.Net35/StackyClientAsync/TagMethods.cs

     {
         private void GetTags(Action<IPagedList<Tag>> onSuccess, Action<ApiException> onError, string method, string[] urlParameters, string filter, string sort, string order, int? page, int? pageSize, DateTime? fromDate, DateTime? toDate, int? min, int? max)
         {
-            MakeRequest<TagResponse>(method, urlParameters, new
+            MakeRequest<Tag>(method, urlParameters, new
             {
                 site = this.SiteUrlName,
                 page = page ?? null,
                 todate = toDate.HasValue ? (long?)toDate.Value.ToUnixTime() : null,
                 min = min ?? null,
                 max = max ?? null
-            }, (items) => onSuccess(new PagedList<Tag>(items.Tags, items)), onError);
+            }, (items) => onSuccess(new PagedList<Tag>(items)), onError);
         }
 
         public virtual void GetTags(Action<IPagedList<Tag>> onSuccess, Action<ApiException> onError)

trunk/source/Stacky.Net35/StackyClientAsync/UserMethods.cs

     {
         private void GetUsers(Action<IPagedList<User>> onSuccess, Action<ApiException> onError, string[] urlParameters, UserOptions options)
         {
-            MakeRequest<UserResponse>("users", urlParameters, new
+            MakeRequest<User>("users", urlParameters, new
             {
                 site = this.SiteUrlName,
                 page = options.Page ?? null,
                 todate = options.ToDate.HasValue ? (long?)options.ToDate.Value.ToUnixTime() : null,
                 min = options.Min ?? null,
                 max = options.Max ?? null
-            }, (items) => onSuccess(new PagedList<User>(items.Users, items)), onError);
+            }, (items) => onSuccess(new PagedList<User>(items)), onError);
         }
 
         public virtual void GetUsers(Action<IPagedList<User>> onSuccess, Action<ApiException> onError)
 
         public virtual void GetUserMentions(IEnumerable<int> userIds, Action<IPagedList<Comment>> onSuccess, Action<ApiException> onError, UserOptions options)
         {
-            MakeRequest<CommentResponse>("users", new string[] { userIds.Vectorize(), "mentioned" }, new
+            MakeRequest<Comment>("users", new string[] { userIds.Vectorize(), "mentioned" }, new
             {
                 site = this.SiteUrlName,
                 page = options.Page ?? null,
                 todate = options.ToDate.HasValue ? (long?)options.ToDate.Value.ToUnixTime() : null,
                 min = options.Min ?? null,
                 max = options.Max ?? null
-            }, (items) => onSuccess(new PagedList<Comment>(items.Comments, items)), onError);
+            }, (items) => onSuccess(new PagedList<Comment>(items)), onError);
         }
 
         public virtual void GetUserTimeline(int userId, Action<IPagedList<UserEvent>> onSuccess, Action<ApiException> onError)
 
         public virtual void GetUserTimeline(IEnumerable<int> userIds, Action<IPagedList<UserEvent>> onSuccess, Action<ApiException> onError, UserTimelineOptions options)
         {
-            MakeRequest<UserEventResponse>("users", new string[] { userIds.Vectorize(), "timeline" }, new
+            MakeRequest<UserEvent>("users", new string[] { userIds.Vectorize(), "timeline" }, new
             {
                 site = this.SiteUrlName,
                 fromdate = options.FromDate.HasValue ? (long?)options.FromDate.Value.ToUnixTime() : null,
                 todate = options.ToDate.HasValue ? (long?)options.ToDate.Value.ToUnixTime() : null,
                 page = options.Page ?? null,
                 pagesize = options.PageSize ?? null
-            }, (items) => onSuccess(new PagedList<UserEvent>(items.Events, items)), onError);
+            }, (items) => onSuccess(new PagedList<UserEvent>(items)), onError);
         }
 
         public virtual void GetUserReputation(int userId, Action<IPagedList<Reputation>> onSuccess, Action<ApiException> onError)
 
         public virtual void GetUserReputation(IEnumerable<int> userIds, Action<IPagedList<Reputation>> onSuccess, Action<ApiException> onError, ReputationOptions options)
         {
-            MakeRequest<ReputationResponse>("users", new string[] { userIds.Vectorize(), "reputation" }, new
+            MakeRequest<Reputation>("users", new string[] { userIds.Vectorize(), "reputation" }, new
             {
                 site = this.SiteUrlName,
                 fromdate = options.FromDate.HasValue ? (long?)options.FromDate.Value.ToUnixTime() : null,
                 todate = options.ToDate.HasValue ? (long?)options.ToDate.Value.ToUnixTime() : null,
                 page = options.Page ?? null,
                 pagesize = options.PageSize ?? null
-            }, (items) => onSuccess(new PagedList<Reputation>(items.Reputation, items)), onError);
+            }, (items) => onSuccess(new PagedList<Reputation>(items)), onError);
         }
     }
 }

trunk/source/Stacky.Silverlight/Stacky.Silverlight.csproj

     <Compile Include="..\Stacky\Enums\UserSort.cs">
       <Link>Enums\UserSort.cs</Link>
     </Compile>
+    <Compile Include="..\Stacky\ErrorResponse.cs">
+      <Link>ErrorResponse.cs</Link>
+    </Compile>
     <Compile Include="..\Stacky\Helpers\DateHelper.cs">
       <Link>Helpers\DateHelper.cs</Link>
     </Compile>
     <Compile Include="..\Stacky\Interfaces\IPagedList.cs">
       <Link>Interfaces\IPagedList.cs</Link>
     </Compile>
+    <Compile Include="..\Stacky\Interfaces\IPayload.cs">
+      <Link>Interfaces\IPayload.cs</Link>
+    </Compile>
     <Compile Include="..\Stacky\Interfaces\IProtocol.cs">
       <Link>Interfaces\IProtocol.cs</Link>
     </Compile>
-    <Compile Include="..\Stacky\Interfaces\IResponse.cs">
-      <Link>Interfaces\IResponse.cs</Link>
-    </Compile>
     <Compile Include="..\Stacky\Interfaces\IUrlClientAsync.cs">
       <Link>Interfaces\IUrlClientAsync.cs</Link>
     </Compile>
     <Compile Include="..\Stacky\PagedList.cs">
       <Link>PagedList.cs</Link>
     </Compile>
+    <Compile Include="..\Stacky\Protocols\JsonPayload.cs">
+      <Link>Protocols\JsonPayload.cs</Link>
+    </Compile>
     <Compile Include="..\Stacky\Protocols\JsonProtocol.cs">
       <Link>Protocols\JsonProtocol.cs</Link>
     </Compile>
-    <Compile Include="..\Stacky\Protocols\JsonResponse.cs">
-      <Link>Protocols\JsonResponse.cs</Link>
-    </Compile>
-    <Compile Include="..\Stacky\Responses\AnswerResponse.cs">
-      <Link>Responses\AnswerResponse.cs</Link>
-    </Compile>
-    <Compile Include="..\Stacky\Responses\AssociatedUsersResponse.cs">
-      <Link>Responses\AssociatedUsersResponse.cs</Link>
-    </Compile>
-    <Compile Include="..\Stacky\Responses\BadgeResponse.cs">
-      <Link>Responses\BadgeResponse.cs</Link>
-    </Compile>
-    <Compile Include="..\Stacky\Responses\CommentResponse.cs">
-      <Link>Responses\CommentResponse.cs</Link>
-    </Compile>
-    <Compile Include="..\Stacky\Responses\ErrorResponse.cs">
-      <Link>Responses\ErrorResponse.cs</Link>
-    </Compile>
-    <Compile Include="..\Stacky\Responses\PrivilegeResponse.cs">
-      <Link>Responses\PrivilegeResponse.cs</Link>
-    </Compile>
-    <Compile Include="..\Stacky\Responses\QuestionResponse.cs">
-      <Link>Responses\QuestionResponse.cs</Link>
-    </Compile>
-    <Compile Include="..\Stacky\Responses\QuestionTimelineResponse.cs">
-      <Link>Responses\QuestionTimelineResponse.cs</Link>
-    </Compile>
-    <Compile Include="..\Stacky\Responses\ReputationResponse.cs">
-      <Link>Responses\ReputationResponse.cs</Link>
-    </Compile>
-    <Compile Include="..\Stacky\Responses\Response.cs">
-      <Link>Responses\Response.cs</Link>
-    </Compile>
-    <Compile Include="..\Stacky\Responses\RevisionResponse.cs">
-      <Link>Responses\RevisionResponse.cs</Link>
-    </Compile>
-    <Compile Include="..\Stacky\Responses\SitesResponse.cs">
-      <Link>Responses\SitesResponse.cs</Link>
-    </Compile>
-    <Compile Include="..\Stacky\Responses\StatsResponse.cs">
-      <Link>Responses\StatsResponse.cs</Link>
-    </Compile>
-    <Compile Include="..\Stacky\Responses\TagResponse.cs">
-      <Link>Responses\TagResponse.cs</Link>
-    </Compile>
-    <Compile Include="..\Stacky\Responses\TagSynonymResponse.cs">
-      <Link>Responses\TagSynonymResponse.cs</Link>
-    </Compile>
-    <Compile Include="..\Stacky\Responses\TagWikiResponse.cs">
-      <Link>Responses\TagWikiResponse.cs</Link>
-    </Compile>
-    <Compile Include="..\Stacky\Responses\TopTagResponse.cs">
-      <Link>Responses\TopTagResponse.cs</Link>
-    </Compile>
-    <Compile Include="..\Stacky\Responses\TopUserResponse.cs">
-      <Link>Responses\TopUserResponse.cs</Link>
-    </Compile>
-    <Compile Include="..\Stacky\Responses\UserEventResponse.cs">
-      <Link>Responses\UserEventResponse.cs</Link>
-    </Compile>
-    <Compile Include="..\Stacky\Responses\UserResponse.cs">
-      <Link>Responses\UserResponse.cs</Link>
+    <Compile Include="..\Stacky\Response.cs">
+      <Link>Response.cs</Link>
     </Compile>
     <Compile Include="..\Stacky\Sites.cs">
       <Link>Sites.cs</Link>

trunk/source/Stacky.WindowsPhone/Stacky.WindowsPhone.csproj

     <Compile Include="..\Stacky\Enums\UserSort.cs">
       <Link>Enums\UserSort.cs</Link>
     </Compile>
+    <Compile Include="..\Stacky\ErrorResponse.cs">
+      <Link>ErrorResponse.cs</Link>
+    </Compile>
     <Compile Include="..\Stacky\Helpers\DateHelper.cs">
       <Link>Helpers\DateHelper.cs</Link>
     </Compile>
     <Compile Include="..\Stacky\Interfaces\IPagedList.cs">
       <Link>Interfaces\IPagedList.cs</Link>
     </Compile>
+    <Compile Include="..\Stacky\Interfaces\IPayload.cs">
+      <Link>Interfaces\IPayload.cs</Link>
+    </Compile>
     <Compile Include="..\Stacky\Interfaces\IProtocol.cs">
       <Link>Interfaces\IProtocol.cs</Link>
     </Compile>
-    <Compile Include="..\Stacky\Interfaces\IResponse.cs">
-      <Link>Interfaces\IResponse.cs</Link>
-    </Compile>
     <Compile Include="..\Stacky\Interfaces\IUrlClientAsync.cs">
       <Link>Interfaces\IUrlClientAsync.cs</Link>
     </Compile>
     <Compile Include="..\Stacky\PagedList.cs">
       <Link>PagedList.cs</Link>
     </Compile>
+    <Compile Include="..\Stacky\Protocols\JsonPayload.cs">
+      <Link>Protocols\JsonPayload.cs</Link>
+    </Compile>
     <Compile Include="..\Stacky\Protocols\JsonProtocol.cs">
       <Link>Protocols\JsonProtocol.cs</Link>
     </Compile>
-    <Compile Include="..\Stacky\Protocols\JsonResponse.cs">
-      <Link>Protocols\JsonResponse.cs</Link>
-    </Compile>
-    <Compile Include="..\Stacky\Responses\AnswerResponse.cs">
-      <Link>Responses\AnswerResponse.cs</Link>
-    </Compile>
-    <Compile Include="..\Stacky\Responses\AssociatedUsersResponse.cs">
-      <Link>Responses\AssociatedUsersResponse.cs</Link>
-    </Compile>
-    <Compile Include="..\Stacky\Responses\BadgeResponse.cs">
-      <Link>Responses\BadgeResponse.cs</Link>
-    </Compile>
-    <Compile Include="..\Stacky\Responses\CommentResponse.cs">
-      <Link>Responses\CommentResponse.cs</Link>
-    </Compile>
-    <Compile Include="..\Stacky\Responses\ErrorResponse.cs">
-      <Link>Responses\ErrorResponse.cs</Link>
-    </Compile>
-    <Compile Include="..\Stacky\Responses\PrivilegeResponse.cs">
-      <Link>Responses\PrivilegeResponse.cs</Link>
-    </Compile>
-    <Compile Include="..\Stacky\Responses\QuestionResponse.cs">
-      <Link>Responses\QuestionResponse.cs</Link>
-    </Compile>
-    <Compile Include="..\Stacky\Responses\QuestionTimelineResponse.cs">
-      <Link>Responses\QuestionTimelineResponse.cs</Link>
-    </Compile>
-    <Compile Include="..\Stacky\Responses\ReputationResponse.cs">
-      <Link>Responses\ReputationResponse.cs</Link>
-    </Compile>
-    <Compile Include="..\Stacky\Responses\Response.cs">
-      <Link>Responses\Response.cs</Link>
-    </Compile>
-    <Compile Include="..\Stacky\Responses\RevisionResponse.cs">
-      <Link>Responses\RevisionResponse.cs</Link>
-    </Compile>
-    <Compile Include="..\Stacky\Responses\SitesResponse.cs">
-      <Link>Responses\SitesResponse.cs</Link>
-    </Compile>
-    <Compile Include="..\Stacky\Responses\StatsResponse.cs">
-      <Link>Responses\StatsResponse.cs</Link>
-    </Compile>
-    <Compile Include="..\Stacky\Responses\TagResponse.cs">
-      <Link>Responses\TagResponse.cs</Link>
-    </Compile>
-    <Compile Include="..\Stacky\Responses\TagSynonymResponse.cs">
-      <Link>Responses\TagSynonymResponse.cs</Link>
-    </Compile>
-    <Compile Include="..\Stacky\Responses\TagWikiResponse.cs">
-      <Link>Responses\TagWikiResponse.cs</Link>
-    </Compile>
-    <Compile Include="..\Stacky\Responses\TopTagResponse.cs">
-      <Link>Responses\TopTagResponse.cs</Link>
-    </Compile>
-    <Compile Include="..\Stacky\Responses\TopUserResponse.cs">
-      <Link>Responses\TopUserResponse.cs</Link>
-    </Compile>
-    <Compile Include="..\Stacky\Responses\UserEventResponse.cs">
-      <Link>Responses\UserEventResponse.cs</Link>
-    </Compile>
-    <Compile Include="..\Stacky\Responses\UserResponse.cs">
-      <Link>Responses\UserResponse.cs</Link>
+    <Compile Include="..\Stacky\Response.cs">
+      <Link>Response.cs</Link>
     </Compile>
     <Compile Include="..\Stacky\Sites.cs">
       <Link>Sites.cs</Link>

trunk/source/Stacky/Interfaces/IPagedList.cs

-using System.Collections.Generic;
+namespace Stacky
+{
+    using System.Collections.Generic;
 
-namespace Stacky
-{
     public interface IPagedList<T> : IEnumerable<T>
     {
-        int TotalItems { get; set; }
-        int CurrentPage { get; set; }
-        int PageSize { get; set; }
+        int TotalItems { get; }
+        int CurrentPage { get; }
+        int PageSize { get; }
+        int Count { get; }
     }
 }

trunk/source/Stacky/Interfaces/IProtocol.cs

 {
     public interface IProtocol
     {
-        IResponse<T> GetResponse<T>(string message) where T : new();
+        IPayload<T> GetResponse<T>(string message) where T : new();
     }
 }

trunk/source/Stacky/Interfaces/IResponse.cs

-namespace Stacky
-{
-    public interface IResponse<T>
-        where T : new()
-    {
-        string Body { get; }
-        ResponseError Error { get; }
-        string Method { get; }
-        T Data { get; set; }
-    }
-}

trunk/source/Stacky/PagedList.cs

-using System.Collections.Generic;
+namespace Stacky
+{
+    using System.Collections.Generic;
 
-namespace Stacky
-{
     public class PagedList<T> : IPagedList<T>
     {
-        public int TotalItems { get; set; }
-        public int CurrentPage { get; set; }
-        public int PageSize { get; set; }
+        public int TotalItems { get; private set; }
+        public int CurrentPage { get; private set; }
+        public int PageSize { get; private set; }
+
+        public int Count
+        {
+            get
+            {
+                if (Items == null)
+                    return 0;
+                return Items.Count;
+            }
+        }
 
         public PagedList(IEnumerable<T> items)
         {
             Items = new List<T>(items);
         }
 
-        public PagedList(IEnumerable<T> items, Response response)
+        public PagedList(Response<T> response)
+            : this(response.Items, response)
+        {
+        }
+
+        private PagedList(IEnumerable<T> items, Response response)
             : this(items)
         {
             TotalItems = response.Total;

trunk/source/Stacky/Protocols/JsonProtocol.cs

 {
     public class JsonProtocol : IProtocol
     {
-        public IResponse<T> GetResponse<T>(string message) where T : new()
+        public IPayload<T> GetResponse<T>(string message) where T : new()
         {
-            return new JsonResponse<T>(message);
+            return new JsonPayload<T>(message);
         }
     }
 }

trunk/source/Stacky/Protocols/JsonResponse.cs

-#region Using Directives
-
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using Newtonsoft.Json;
-using System.IO;
-using System.Text.RegularExpressions;
-
-#endregion
-
-namespace Stacky
-{
-    public class JsonResponse<T> : IResponse<T>
-        where T : new()
-    {
-        public ResponseError Error { get; set; }
-        public string Method { get; set; }
-        public string Body { get; set; }
-
-        public T Data { get; set; }
-
-        public JsonResponse()
-        {
-        }
-
-        public JsonResponse(string json)
-        {
-            Parse(json, this);
-        }
-
-        protected static void Parse<T>(string json, JsonResponse<T> response)
-           where T : new()
-        {
-            response.Body = json;
-            if (json.Contains("\"error\":"))
-            {
-
-                response.Error = SerializationHelper.DeserializeJson<ErrorResponse>(json).Error;
-                return;
-            }
-            response.Data = SerializationHelper.DeserializeJson<T>(json);
-        }
-    }
-}

trunk/source/Stacky/Responses/AnswerResponse.cs

-using System.Collections.Generic;
-using Newtonsoft.Json;
-
-namespace Stacky
-{
-    public class AnswerResponse : Response
-    {
-        [JsonProperty("answers")]
-        public List<Answer> Answers { get; set; }
-    }
-}

trunk/source/Stacky/Responses/AssociatedUsersResponse.cs

-using System.Collections.Generic;
-using Newtonsoft.Json;
-
-namespace Stacky
-{
-    public class AssociatedUsersResponse
-    {
-        [JsonProperty("items")]
-        public List<AssociatedUser> Users { get; set; }
-    }
-}

trunk/source/Stacky/Responses/BadgeResponse.cs

-using System.Collections.Generic;
-using Newtonsoft.Json;
-
-namespace Stacky
-{
-    public class BadgeResponse : Response
-    {
-        [JsonProperty("badges")]
-        public List<Badge> Badges { get; set; }
-    }
-}

trunk/source/Stacky/Responses/CommentResponse.cs

-using System.Collections.Generic;
-using Newtonsoft.Json;
-
-namespace Stacky
-{
-    public class CommentResponse : Response
-    {
-        [JsonProperty("comments")]
-        public List<Comment> Comments { get; set; }
-    }
-}

trunk/source/Stacky/Responses/ErrorResponse.cs

-using Newtonsoft.Json;
-
-namespace Stacky
-{
-    public class ErrorResponse
-    {
-        [JsonProperty("error")]
-        public ResponseError Error { get; set; }
-    }
-}

trunk/source/Stacky/Responses/PrivilegeResponse.cs

-using System.Collections.Generic;
-using Newtonsoft.Json;
-
-namespace Stacky
-{
-    public class PrivilegeResponse
-    {
-        [JsonProperty("privileges")]
-        public List<Privilege> Privileges { get; set; }
-    }
-}

trunk/source/Stacky/Responses/QuestionResponse.cs

-using System.Collections.Generic;
-using Newtonsoft.Json;
-
-namespace Stacky
-{
-    public class QuestionResponse : Response
-    {
-        [JsonProperty("questions")]
-        public List<Question> Questions { get; set; }
-    }
-}

trunk/source/Stacky/Responses/QuestionTimelineResponse.cs

-using System.Collections.Generic;
-using Newtonsoft.Json;
-
-namespace Stacky
-{
-    public class QuestionTimelineResponse : Response
-    {
-        [JsonProperty("post_timelines")]
-        public List<PostEvent> Events { get; set; }
-    }
-}

trunk/source/Stacky/Responses/ReputationResponse.cs

-using System.Collections.Generic;
-using Newtonsoft.Json;
-
-namespace Stacky
-{
-    public class ReputationResponse : Response
-    {
-        [JsonProperty("rep_changes")]
-        public List<Reputation> Reputation { get; set; }
-    }
-}

trunk/source/Stacky/Responses/Response.cs

-using System.Collections.Generic;
-using Newtonsoft.Json;
-
-namespace Stacky
-{
-    public abstract class Response
-    {
-        [JsonProperty("total")]
-        public int Total { get; set; }
-
-        [JsonProperty("page")]
-        public int CurrentPage { get; set; }
-
-        [JsonProperty("pagesize")]
-        public int PageSize { get; set; }
-
-        public ResponseError Error { get; set; }
-    }
-}

trunk/source/Stacky/Responses/RevisionResponse.cs

-using System.Collections.Generic;
-using Newtonsoft.Json;
-
-namespace Stacky
-{
-    public class RevisionResponse : Response
-    {
-        [JsonProperty("revisions")]
-        public List<Revision> Revisions { get; set; }
-    }
-}

trunk/source/Stacky/Responses/SitesResponse.cs

-using System.Collections.Generic;
-using Newtonsoft.Json;
-
-namespace Stacky
-{
-    public class SitesResponse
-    {
-        [JsonProperty("items")]
-        public List<SiteInfo> Sites { get; set; }
-    }
-}

trunk/source/Stacky/Responses/StatsResponse.cs

-using System.Collections.Generic;
-using Newtonsoft.Json;
-
-namespace Stacky
-{
-    public class StatsResponse
-    {
-        [JsonProperty("statistics")]
-        public List<SiteStats> Statistics { get; set; }
-    }
-}

trunk/source/Stacky/Responses/TagResponse.cs

-using System.Collections.Generic;
-using Newtonsoft.Json;
-
-namespace Stacky
-{
-    public class TagResponse : Response
-    {
-        [JsonProperty("tags")]
-        public List<Tag> Tags { get; set; }
-    }
-}

trunk/source/Stacky/Responses/TagSynonymResponse.cs

-using System.Collections.Generic;
-using Newtonsoft.Json;
-
-namespace Stacky
-{
-    public class TagSynonymResponse : Response
-    {
-        [JsonProperty("tag_synonyms")]
-        public List<TagSynonym> TagSynonyms { get; set; }
-    }
-}

trunk/source/Stacky/Responses/TagWikiResponse.cs

-using System.Collections.Generic;
-using Newtonsoft.Json;
-
-namespace Stacky
-{
-    public class TagWikiResponse : Response
-    {
-        [JsonProperty("tag_wikis")]
-        public List<TagWiki> TagWikis { get; set; }
-    }
-}

trunk/source/Stacky/Responses/TopTagResponse.cs

-using System.Collections.Generic;
-using Newtonsoft.Json;
-
-namespace Stacky
-{
-    public class TopTagResponse : Response
-    {
-        [JsonProperty("top_tags")]
-        public List<TopTag> TopTags { get; set; }
-    }
-}

trunk/source/Stacky/Responses/TopUserResponse.cs

-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using Newtonsoft.Json;
-
-namespace Stacky
-{
-    public class TopUserResponse : Response
-    {
-        [JsonProperty("top_users")]
-        public List<TopUser> TopUsers { get; set; }
-    }
-}

trunk/source/Stacky/Responses/UserEventResponse.cs

-using System.Collections.Generic;
-using Newtonsoft.Json;
-
-namespace Stacky
-{
-    public class UserEventResponse : Response
-    {
-        [JsonProperty("user_timelines")]
-        public List<UserEvent> Events { get; set; }
-    }
-}

trunk/source/Stacky/Responses/UserResponse.cs

-using System.Collections.Generic;
-using Newtonsoft.Json;
-
-namespace Stacky
-{
-    public class UserResponse : Response
-    {
-        [JsonProperty("users")]
-        public List<User> Users { get; set; }
-    }
-}

trunk/source/Stacky/Stacky.csproj

     <Compile Include="Enums\UserEventType.cs" />
     <Compile Include="Enums\UserMentionSort.cs" />
     <Compile Include="Enums\UserSort.cs" />
+    <Compile Include="ErrorResponse.cs" />
     <Compile Include="Helpers\DateHelper.cs" />
     <Compile Include="Helpers\EnumHelper.cs" />
     <Compile Include="Helpers\Execute.cs" />
     <Compile Include="HttpResponse.cs" />
     <Compile Include="Interfaces\IPagedList.cs" />
     <Compile Include="Interfaces\IProtocol.cs" />
-    <Compile Include="Interfaces\IResponse.cs" />
+    <Compile Include="Interfaces\IPayload.cs" />
     <Compile Include="Interfaces\IUrlClient.cs" />
     <Compile Include="Interfaces\IUrlClientAsync.cs" />
     <Compile Include="PagedList.cs" />
     <Compile Include="Helpers\Paging\Pager.cs" />
     <Compile Include="Properties\AssemblyInfo.cs" />
     <Compile Include="Protocols\JsonProtocol.cs" />
-    <Compile Include="Protocols\JsonResponse.cs" />
-    <Compile Include="Responses\AnswerResponse.cs" />
-    <Compile Include="Responses\AssociatedUsersResponse.cs" />
-    <Compile Include="Responses\BadgeResponse.cs" />
-    <Compile Include="Responses\CommentResponse.cs" />
-    <Compile Include="Responses\ErrorResponse.cs" />
-    <Compile Include="Responses\PrivilegeResponse.cs" />
-    <Compile Include="Responses\QuestionResponse.cs" />
-    <Compile Include="Responses\QuestionTimelineResponse.cs" />
-    <Compile Include="Responses\ReputationResponse.cs" />
-    <Compile Include="Responses\Response.cs" />
-    <Compile Include="Responses\RevisionResponse.cs" />
-    <Compile Include="Responses\SitesResponse.cs" />
-    <Compile Include="Responses\StatsResponse.cs" />
-    <Compile Include="Responses\TagResponse.cs" />
-    <Compile Include="Responses\TagSynonymResponse.cs" />
-    <Compile Include="Responses\TagWikiResponse.cs" />
-    <Compile Include="Responses\TopTagResponse.cs" />
-    <Compile Include="Responses\TopUserResponse.cs" />
-    <Compile Include="Responses\UserEventResponse.cs" />
-    <Compile Include="Responses\UserResponse.cs" />
+    <Compile Include="Protocols\JsonPayload.cs" />
+    <Compile Include="Response.cs" />
     <Compile Include="Sites.cs" />
     <Compile Include="StackyClientAsync\AnswerMethods.cs" />
     <Compile Include="StackyClientAsync\BadgeMethods.cs" />

trunk/source/Stacky/StackyClient/AnswerMethods.cs

 
 namespace Stacky
 {
-    /// <summary>
-    /// 
-    /// </summary>
     public partial class StackyClient
-    {
-
-        /// <summary>
-        /// Gets the users answers.
-        /// </summary>
-        /// <param name="userId">The user id.</param>
-        /// <param name="sortBy">The sort by.</param>
-        /// <param name="sortDirection">The sort direction.</param>
-        /// <param name="page">The page.</param>
-        /// <param name="pageSize">Size of the page.</param>
-        /// <param name="includeBody">if set to <c>true</c> [include body].</param>
-        /// <param name="includeComments">if set to <c>true</c> [include comments].</param>
-        /// <param name="min">The min.</param>
-        /// <param name="max">The max.</param>
-        /// <param name="fromDate">From date.</param>
-        /// <param name="toDate">To date.</param>
-        /// <returns></returns>
+    {   
         public virtual IPagedList<Answer> GetUsersAnswers(int userId, QuestionsByUserSort sortBy = QuestionsByUserSort.Activity, SortDirection sortDirection = SortDirection.Descending, int? page = null, int? pageSize = null, bool includeBody = false, bool includeComments = false, int? min = null, int? max = null, DateTime? fromDate = null, DateTime? toDate = null)
         {
             return GetUsersAnswers(userId.ToArray(), sortBy, sortDirection, page, pageSize, includeBody, includeComments, min, max, fromDate, toDate);
         }
 
-        /// <summary>
-        /// Gets the users answers.
-        /// </summary>
-        /// <param name="userIds">The user ids.</param>
-        /// <param name="sortBy">The sort by.</param>
-        /// <param name="sortDirection">The sort direction.</param>
-        /// <param name="page">The page.</param>
-        /// <param name="pageSize">Size of the page.</param>
-        /// <param name="includeBody">if set to <c>true</c> [include body].</param>
-        /// <param name="includeComments">if set to <c>true</c> [include comments].</param>
-        /// <param name="min">The min.</param>
-        /// <param name="max">The max.</param>
-        /// <param name="fromDate">From date.</param>
-        /// <param name="toDate">To date.</param>
-        /// <returns></returns>
         public virtual IPagedList<Answer> GetUsersAnswers(IEnumerable<int> userIds, QuestionsByUserSort sortBy = QuestionsByUserSort.Creation, SortDirection sortDirection = SortDirection.Descending, int? page = null, int? pageSize = null, bool includeBody = false, bool includeComments = false, int? min = null, int? max = null, DateTime? fromDate = null, DateTime? toDate = null)
         {
-            var response = MakeRequest<AnswerResponse>("users", new string[] { userIds.Vectorize(), "answers" }, new
+            var response = MakeRequest<Answer>("users", new string[] { userIds.Vectorize(), "answers" }, new
             {
                 site = this.SiteUrlName,
                 page = page ?? null,
                 fromdate = fromDate.HasValue ? (long?)fromDate.Value.ToUnixTime() : null,
                 todate = toDate.HasValue ? (long?)toDate.Value.ToUnixTime() : null
             });
-            return new PagedList<Answer>(response.Answers, response);
+            return new PagedList<Answer>(response);
         }
 
         /// <summary>
         /// <returns></returns>
         public virtual IPagedList<Answer> GetQuestionAnswers(IEnumerable<int> questionIds, QuestionsByUserSort sortBy = QuestionsByUserSort.Activity, SortDirection sortDirection = SortDirection.Descending, int? page = null, int? pageSize = null, bool includeBody = false, bool includeComments = false, int? min = null, int? max = null, DateTime? fromDate = null, DateTime? toDate = null)
         {
-            var response = MakeRequest<AnswerResponse>("questions", new string[] { questionIds.Vectorize(), "answers" }, new
+            var response = MakeRequest<Answer>("questions", new string[] { questionIds.Vectorize(), "answers" }, new
             {
                 site = this.SiteUrlName,
                 page = page ?? null,
                 fromdate = fromDate.HasValue ? (long?)fromDate.Value.ToUnixTime() : null,
                 todate = toDate.HasValue ? (long?)toDate.Value.ToUnixTime() : null
             });
-            return new PagedList<Answer>(response.Answers, response);
+            return new PagedList<Answer>(response);
         }
 
         /// <summary>
 
         public virtual IPagedList<Answer> GetAnswers(IEnumerable<int> answerIds, AnswerSort sortBy = AnswerSort.Activity, SortDirection sortDirection = SortDirection.Descending, int? page = null, int? pageSize = null, bool includeBody = false, bool includeComments = false, int? min = null, int? max = null, DateTime? fromDate = null, DateTime? toDate = null)
         {
-            var response = MakeRequest<AnswerResponse>("answers", new string[] { answerIds.Vectorize() }, new
+            var response = MakeRequest<Answer>("answers", new string[] { answerIds.Vectorize() }, new
             {
                 site = this.SiteUrlName,
                 page = page ?? null,
                 fromdate = fromDate.HasValue ? (long?)fromDate.Value.ToUnixTime() : null,
                 todate = toDate.HasValue ? (long?)toDate.Value.ToUnixTime() : null
             });
-            return new PagedList<Answer>(response.Answers, response);
+            return new PagedList<Answer>(response);
         }
 
         /// <summary>
         /// <returns></returns>
         public virtual IPagedList<Answer> GetAnswers(AnswerSort sortBy = AnswerSort.Activity, SortDirection sortDirection = SortDirection.Descending, int? page = null, int? pageSize = null, bool includeBody = false, bool includeComments = false, bool includeAnswers = false, int? min = null, int? max = null, DateTime? fromDate = null, DateTime? toDate = null)
         {
-            var response = MakeRequest<AnswerResponse>("answers", null, new
+            var response = MakeRequest<Answer>("answers", null, new
             {
                 site = this.SiteUrlName,
                 page = page ?? null,
                 fromdate = fromDate.HasValue ? (long?)fromDate.Value.ToUnixTime() : null,
                 todate = toDate.HasValue ? (long?)toDate.Value.ToUnixTime() : null
             });
-            return new PagedList<Answer>(response.Answers, response);
+            return new PagedList<Answer>(response);
         }
     }
 }

trunk/source/Stacky/StackyClient/BadgeMethods.cs

 
         private IEnumerable<Badge> GetBadges(string method, string[] urlArguments)
         {
-            return MakeRequest<BadgeResponse>(method, urlArguments, new
+            return MakeRequest<Badge>(method, urlArguments, new
             {
                 site = this.SiteUrlName,
-            }).Badges;
+            }).Items;
         }
 
         public virtual IEnumerable<User> GetUsersByBadge(int badgeId, int? page = null, int? pageSize = null, DateTime? fromDate = null, DateTime? toDate = null)
 
         public virtual IPagedList<User> GetUsersByBadge(IEnumerable<int> badgeIds, int? page = null, int? pageSize = null, DateTime? fromDate = null, DateTime? toDate = null)
         {
-            var response = MakeRequest<UserResponse>("badges", new string[] { badgeIds.Vectorize() }, new
+            var response = MakeRequest<User>("badges", new string[] { badgeIds.Vectorize() }, new
             {
                 site = this.SiteUrlName,
                 page = page ?? null,
                 fromdate = fromDate.HasValue ? (long?)fromDate.Value.ToUnixTime() : null,
                 todate = toDate.HasValue ? (long?)toDate.Value.ToUnixTime() : null
             });
-            return new PagedList<User>(response.Users, response);
+            return new PagedList<User>(response);
         }
 
         public virtual IEnumerable<Badge> GetTagBasedBadges()
 
         public virtual IEnumerable<Badge> GetUserBadges(IEnumerable<int> userIds)
         {
-            return MakeRequest<BadgeResponse>("users", new string[] { userIds.Vectorize(), "badges" }, new
+            return MakeRequest<Badge>("users", new string[] { userIds.Vectorize(), "badges" }, new
             {
                 site = this.SiteUrlName
-            }).Badges;
+            }).Items;
         }
     }
 }

trunk/source/Stacky/StackyClient/CommentMethods.cs

                 urlParameters = new string[] { fromUserIds.Vectorize(), "comments" };
             }
 
-            var response = MakeRequest<CommentResponse>("users", urlParameters, new
+            var response = MakeRequest<Comment>("users", urlParameters, new
             {
                 site = this.SiteUrlName,
                 page = page ?? null,
                 min = min ?? null,
                 max = max ?? null
             });
-            return new PagedList<Comment>(response.Comments, response);
+            return new PagedList<Comment>(response);
         }
 
         public virtual IPagedList<Comment> GetComments(int fromUserId, CommentSort sortBy = CommentSort.Creation, SortDirection sortDirection = SortDirection.Descending, int? toUserId = null, int? page = null, int? pageSize = null, DateTime? fromDate = null, DateTime? toDate = null, int? min = null, int? max = null)
 
         public virtual IPagedList<Comment> GetCommentsByPost(IEnumerable<int> postIds, CommentSort sortBy = CommentSort.Creation, SortDirection sortDirection = SortDirection.Descending, int? page = null, int? pageSize = null, DateTime? fromDate = null, DateTime? toDate = null, int? min = null, int? max = null)
         {
-            var response = MakeRequest<CommentResponse>("posts", new string[] { postIds.Vectorize(), "comments" }, new
+            var response = MakeRequest<Comment>("posts", new string[] { postIds.Vectorize(), "comments" }, new
             {
                 site = this.SiteUrlName,
                 page = page ?? null,
                 min = min ?? null,
                 max = max ?? null
             });
-            return new PagedList<Comment>(response.Comments, response);
+            return new PagedList<Comment>(response);
         }
 
         public virtual IPagedList<Comment> GetAnswerComments(int answerId, CommentSort sortBy = CommentSort.Creation, SortDirection sortDirection = SortDirection.Descending, int? page = null, int? pageSize = null, DateTime? fromDate = null, DateTime? toDate = null, int? min = null, int? max = null)
 
         public virtual IPagedList<Comment> GetAnswerComments(IEnumerable<int> answerIds, CommentSort sortBy = CommentSort.Creation, SortDirection sortDirection = SortDirection.Descending, int? page = null, int? pageSize = null, DateTime? fromDate = null, DateTime? toDate = null, int? min = null, int? max = null)
         {
-            var response = MakeRequest<CommentResponse>("answers", new string[] { answerIds.Vectorize(), "comments" }, new
+            var response = MakeRequest<Comment>("answers", new string[] { answerIds.Vectorize(), "comments" }, new
             {
                 site = this.SiteUrlName,
                 page = page ?? null,
                 min = min ?? null,
                 max = max ?? null
             });
-            return new PagedList<Comment>(response.Comments, response);
+            return new PagedList<Comment>(response);
         }
 
         /// <summary>
         /// <returns></returns>
         public virtual IPagedList<Comment> GetComments(CommentSort sortBy = CommentSort.Creation, SortDirection sortDirection = SortDirection.Descending, int? page = null, int? pageSize = null, DateTime? fromDate = null, DateTime? toDate = null, int? min = null, int? max = null)
         {
-            var response = MakeRequest<CommentResponse>("answers", null, new
+            var response = MakeRequest<Comment>("answers", null, new
             {
                 site = this.SiteUrlName,
                 page = page ?? null,
                 min = min ?? null,
                 max = max ?? null
             });
-            return new PagedList<Comment>(response.Comments, response);
+            return new PagedList<Comment>(response);
         }
     }
 }

trunk/source/Stacky/StackyClient/PrivilegeMethods.cs

         /// <returns></returns>
         public IEnumerable<Privilege> GetPrivileges()
         {
-            return MakeRequest<PrivilegeResponse>("privileges", null, new
+            return MakeRequest<Privilege>("privileges", null, new
             {
                 site = this.SiteUrlName
-            }).Privileges;
+            }).Items;
         }
     }
 }

trunk/source/Stacky/StackyClient/QuestionMethods.cs

 
         private IPagedList<Question> GetQuestions(string method, string[] urlArguments, string sort, string sortDirection, int? page, int? pageSize, bool includeBody, bool includeComments, bool includeAnswers, DateTime? fromDate, DateTime? toDate, int? min = null, int? max = null, params string[] tags)
         {
-            var response = MakeRequest<QuestionResponse>(method, urlArguments, new
+            var response = MakeRequest<Question>(method, urlArguments, new
             {
                 site = this.SiteUrlName,
                 page = page ?? null,
                 min = min ?? null,
                 max = max ?? null
             });
-            return new PagedList<Question>(response.Questions, response);
+            return new PagedList<Question>(response);
         }
 
         public virtual IPagedList<Question> GetQuestions(IEnumerable<int> questionIds, int? page = null, int? pageSize = null, bool includeBody = false, bool includeComments = false, bool includeAnswers = false, DateTime? fromDate = null, DateTime? toDate = null, int? min = null, int? max = null, string[] tags = null)
         {
-            var response = MakeRequest<QuestionResponse>("questions", new string[] { questionIds.Vectorize() }, new
+            var response = MakeRequest<Question>("questions", new string[] { questionIds.Vectorize() }, new
             {
                 site = this.SiteUrlName,
                 body = includeBody ? (bool?)true : null,
                 min = min ?? null,
                 max = max ?? null
             });
-            return new PagedList<Question>(response.Questions, response);
+            return new PagedList<Question>(response);
         }
 
         public virtual Question GetQuestion(int questionId, bool includeBody = false, bool includeComments = false, bool includeAnswers = false)
 
         public virtual IPagedList<PostEvent> GetQuestionTimeline(IEnumerable<int> questionIds, int? page = null, int? pageSize = null, DateTime? fromDate = null, DateTime? toDate = null)
         {
-            var response = MakeRequest<QuestionTimelineResponse>("questions", new string[] { questionIds.Vectorize(), "timeline" }, new
+            var response = MakeRequest<PostEvent>("questions", new string[] { questionIds.Vectorize(), "timeline" }, new
             {
                 site = this.SiteUrlName,
                 fromdate = fromDate.HasValue ? (long?)fromDate.Value.ToUnixTime() : null,
                 page = page ?? null,
                 pagesize = pageSize ?? null
             });
-            return new PagedList<PostEvent>(response.Events, response);
+            return new PagedList<PostEvent>(response);
         }
 
         public virtual IPagedList<PostEvent> GetQuestionTimeline(int questionId, int? page = null, int? pageSize = null, DateTime? fromDate = null, DateTime? toDate = null)