Added new appengine sample for discovery, and also cleaned up the latitude future.json file.
diff --git a/apiclient/contrib/latitude/future.json b/apiclient/contrib/latitude/future.json
index 3fef33a..e44d410 100644
--- a/apiclient/contrib/latitude/future.json
+++ b/apiclient/contrib/latitude/future.json
@@ -2,73 +2,73 @@
   "data": {
     "latitude": {
       "v1": {
-        "baseUrl": "https://www.googleapis.com/", 
+        "baseUrl": "https://www.googleapis.com/",
         "auth": {
           "request": {
             "url": "https://www.google.com/accounts/OAuthGetRequestToken",
             "parameters": {
               "xoauth_displayname": {
                 "parameterType": "query",
-                "required": False
+                "required": false
               },
               "domain": {
                 "parameterType": "query",
-                "required": True
+                "required": true
               },
               "scope": {
                 "parameterType": "query",
-                "required": True
-              },
-            },
+                "required": true
+              }
+            }
           },
           "authorize": {
             "url": "https://www.google.com/latitude/apps/OAuthAuthorizeToken",
             "parameters": {
               "oauth_token": {
                 "parameterType": "query",
-                "required": True
+                "required": true
               },
               "iconUrl": {
                 "parameterType": "query",
-                "required": False
+                "required": false
               },
               "domain": {
                 "parameterType": "query",
-                "required": True
+                "required": true
               },
               "scope": {
                 "parameterType": "query",
-                "required": True
-              },
-            },
+                "required": true
+              }
+            }
           },
           "access": {
             "url": "https://www.google.com/accounts/OAuthGetAccessToken",
             "parameters": {
               "domain": {
                 "parameterType": "query",
-                "required": True
+                "required": true
               },
               "scope": {
                 "parameterType": "query",
-                "required": True
-              },
-            },
-          },
+                "required": true
+              }
+            }
+          }
         },
         "resources": {
           "currentLocation": {
             "methods": {
-              "delete": {}, 
-              "get": {}, 
+              "delete": {},
+              "get": {},
               "insert": {}
             }
-          }, 
+          },
           "location": {
             "methods": {
-              "delete": {}, 
-              "get": {}, 
-              "insert": {}, 
+              "delete": {},
+              "get": {},
+              "insert": {},
               "list": {}
             }
           }
diff --git a/apiclient/discovery.py b/apiclient/discovery.py
index 1bac08c..408abd6 100644
--- a/apiclient/discovery.py
+++ b/apiclient/discovery.py
@@ -98,13 +98,15 @@
         raise HttpError(simplejson.loads(content)['error'])
 
 
-def build(serviceName, version, http=httplib2.Http(),
+def build(serviceName, version, http=None,
     discoveryServiceUrl=DISCOVERY_URI, auth=None, model=JsonModel()):
   params = {
       'api': serviceName,
       'apiVersion': version
       }
 
+  if http is None:
+    http = httplib2.Http()
   requested_url = uritemplate.expand(discoveryServiceUrl, params)
   logging.info('URL being requested: %s' % requested_url)
   resp, content = http.request(requested_url)
diff --git a/samples/helpdoc/apiclient b/samples/helpdoc/apiclient
new file mode 120000
index 0000000..22e4c9c
--- /dev/null
+++ b/samples/helpdoc/apiclient
@@ -0,0 +1 @@
+../../apiclient/
\ No newline at end of file
diff --git a/samples/helpdoc/app.yaml b/samples/helpdoc/app.yaml
new file mode 100644
index 0000000..8919c7b
--- /dev/null
+++ b/samples/helpdoc/app.yaml
@@ -0,0 +1,12 @@
+application: google-api-python-client-doc
+version: 1
+runtime: python
+api_version: 1
+
+handlers:
+- url: /static
+  static_dir: static
+
+- url: .*
+  script: main.py
+
diff --git a/samples/helpdoc/httplib2 b/samples/helpdoc/httplib2
new file mode 120000
index 0000000..488ae9f
--- /dev/null
+++ b/samples/helpdoc/httplib2
@@ -0,0 +1 @@
+../../httplib2/
\ No newline at end of file
diff --git a/samples/helpdoc/index.yaml b/samples/helpdoc/index.yaml
new file mode 100644
index 0000000..a3b9e05
--- /dev/null
+++ b/samples/helpdoc/index.yaml
@@ -0,0 +1,11 @@
+indexes:
+
+# AUTOGENERATED
+
+# This index.yaml is automatically updated whenever the dev_appserver
+# detects that a new type of query is run.  If you want to manage the
+# index.yaml file manually, remove the above marker line (the line
+# saying "# AUTOGENERATED").  If you want to manage some indexes
+# manually, move them above the marker line.  The index.yaml file is
+# automatically uploaded to the admin console when you next deploy
+# your application using appcfg.py.
diff --git a/samples/helpdoc/main.py b/samples/helpdoc/main.py
new file mode 100755
index 0000000..969c2bd
--- /dev/null
+++ b/samples/helpdoc/main.py
@@ -0,0 +1,82 @@
+#!/usr/bin/env python
+#
+# Copyright 2007 Google Inc.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+__author__ = 'jcgregorio@google.com (Joe Gregorio)'
+
+
+import httplib2
+import logging
+import os
+import pydoc
+import re
+
+from apiclient.discovery import build
+
+from google.appengine.api import users
+from google.appengine.ext import webapp
+from google.appengine.ext.webapp import template
+from google.appengine.ext.webapp import util
+
+STEP2_URI = 'http://%s.appspot.com/auth_return' % os.environ['APPLICATION_ID']
+
+class MainHandler(webapp.RequestHandler):
+
+  def get(self):
+    self.response.out.write("""
+    <ul>
+      <li><a href='/buzz/v1'>buzz</a>
+      <li><a href='/moderator/v1'>moderator</a>
+      <li><a href='/latitude/v1'>latitude</a>
+    </ul>
+    """)
+
+class ServiceHandler(webapp.RequestHandler):
+
+  def get(self, service_name, version):
+    service = build(service_name, version)
+    page = "<pre>%s</pre>" % pydoc.plain(pydoc.render_doc(service))
+
+    collections = []
+    for name in dir(service):
+      if not "_" in name and callable(getattr(service, name)):
+        collections.append(name)
+
+    for name in collections:
+      page = re.sub('(%s) =' % name, r'<a href="/%s/%s/%s">\1</a> =' % (service_name, version, name), page)
+
+    self.response.out.write(page)
+
+class CollectionHandler(webapp.RequestHandler):
+
+  def get(self, service_name, version, collection):
+    service = build(service_name, version)
+    page = "<pre>%s</pre>" % pydoc.plain(pydoc.render_doc(getattr(service, collection)()))
+    self.response.out.write(page)
+
+def main():
+  application = webapp.WSGIApplication(
+      [
+      (r'/', MainHandler),
+      (r'/(\w*)/(\w*)', ServiceHandler),
+      (r'/(\w*)/(\w*)/(\w*)', CollectionHandler),
+      ],
+      debug=True)
+  util.run_wsgi_app(application)
+
+
+if __name__ == '__main__':
+  main()
diff --git a/samples/helpdoc/oauth2 b/samples/helpdoc/oauth2
new file mode 120000
index 0000000..af104cc
--- /dev/null
+++ b/samples/helpdoc/oauth2
@@ -0,0 +1 @@
+../../oauth2
\ No newline at end of file
diff --git a/samples/helpdoc/simplejson b/samples/helpdoc/simplejson
new file mode 120000
index 0000000..148c7cf
--- /dev/null
+++ b/samples/helpdoc/simplejson
@@ -0,0 +1 @@
+../../simplejson/
\ No newline at end of file
diff --git a/samples/helpdoc/uritemplate b/samples/helpdoc/uritemplate
new file mode 120000
index 0000000..ce92dcb
--- /dev/null
+++ b/samples/helpdoc/uritemplate
@@ -0,0 +1 @@
+../../uritemplate/
\ No newline at end of file