func demoSteadySailorData(writer http.ResponseWriter, request *http.Request) {
	steadySailorDataForEmail(writer, request, DEMO_EMAIL)
}
find the steady sailor for the demo user and retrieve his most recent day's worth of data.
package main
import (
	"encoding/json"
	"errors"
	"fmt"
	"github.com/alexandre-normand/glukit/app/apimodel"
	"github.com/alexandre-normand/glukit/app/engine"
	"github.com/alexandre-normand/glukit/app/model"
	"github.com/alexandre-normand/glukit/app/payment"
	"github.com/alexandre-normand/glukit/app/store"
	"github.com/alexandre-normand/glukit/app/util"
	"github.com/grd/stat"
	"google.golang.org/appengine"
	"google.golang.org/appengine/log"
	"google.golang.org/appengine/user"
	"net/http"
	"sort"
	"strconv"
	"time"
)
type DataResponse struct {
	FirstName    string            `json:"firstName"`
	LastName     string            `json:"lastName"`
	Picture      string            `json:"picture"`
	LastSync     time.Time         `json:"lastSync"`
	Score        *int64            `json:"score"`
	ScoreDetails model.GlukitScore `json:"scoreDetails"`
	JoinedOn     time.Time         `json:"joinedOn"`
	Data         []DataSeries      `json:"data"`
	Trend        string            `json:"trend"`
}
type DataSeries struct {
	Name string               `json:"name"`
	Data []apimodel.DataPoint `json:"data"`
	Type string               `json:"type"`
}
const (
	QUERY_PARAM_LIMIT = "limit"
	QUERY_PARAM_FROM  = "from"
	QUERY_PARAM_TO    = "to"
)
func personalData(writer http.ResponseWriter, request *http.Request) {
	context := appengine.NewContext(request)
	user := user.Current(context)
	mostRecentWeekAsJson(writer, request, user.Email)
}
func demoContent(writer http.ResponseWriter, request *http.Request) {
	mostRecentWeekAsJson(writer, request, DEMO_EMAIL)
}
func mostRecentWeekAsJson(writer http.ResponseWriter, request *http.Request, email string) {
	context := appengine.NewContext(request)
	glukitUser, _, upperBound, err := store.GetUserData(context, email)
	lowerBound := util.GetEndOfDayBoundaryBefore(upperBound).Add(model.DEFAULT_LOOKBACK_PERIOD)
	if err != nil && err == store.ErrNoImportedDataFound {
		log.Debugf(context, "No imported data found for user [%s]", email)
		http.Error(writer, err.Error(), 204)
	} else if err != nil {
		util.Propagate(err)
	} else {
		unitValue, err := resolveGlucoseUnit(email, request)
		if err != nil {
			http.Error(writer, err.Error(), http.StatusInternalServerError)
			return
		}
		reads, err := store.GetGlucoseReads(context, email, lowerBound, upperBound)
		if err != nil {
			util.Propagate(err)
		}
		injections, err := store.GetInjections(context, email, lowerBound, upperBound)
		if err != nil {
			util.Propagate(err)
		}
		carbs, err := store.GetMeals(context, email, lowerBound, upperBound)
		if err != nil {
			util.Propagate(err)
		}
		exercises, err := store.GetExercises(context, email, lowerBound, upperBound)
		if err != nil {
			util.Propagate(err)
		}
		value := writer.Header()
		value.Add("Content-type", "application/json")
		response := DataResponse{FirstName: glukitUser.FirstName, LastName: glukitUser.LastName, Picture: glukitUser.PictureUrl, LastSync: glukitUser.MostRecentRead.GetTime(), Score: engine.CalculateUserFacingScore(glukitUser.MostRecentScore), ScoreDetails: glukitUser.MostRecentScore, JoinedOn: glukitUser.AccountCreated, Data: generateDataSeriesFromData(reads, injections, carbs, exercises, *unitValue)}
		writeAsJson(writer, response)
	}
}
func steadySailorData(writer http.ResponseWriter, request *http.Request) {
	context := appengine.NewContext(request)
	user := user.Current(context)
	steadySailorDataForEmail(writer, request, user.Email)
}