func RespondJSON(w http.ResponseWriter, code int, data interface{}) error {
	w.Header().Set("Content-Type", "application/json; charset=utf-8")
	w.WriteHeader(code)
	res, err := json.Marshal(&data)
	if err != nil {
		return err
	}
	_, err = w.Write(res)
	return err
}
RespondJSON encodes the passed in data as JSON-compatible string and returns
it to the client.
package util
import (
	"encoding/json"
	log "github.com/Sirupsen/logrus"
	"github.com/julienschmidt/httprouter"
	"net/http"
)
type ErrorResponse struct {
	Error  string `json:"error"`
	Reason string `json:"reason"`
}