func NewApiHttp(api ClientApi) *http.ServeMux {
	mux := http.NewServeMux()
	mux.HandleFunc("/healthcheck", HealthCheckHandler())
	mux.HandleFunc("/events", Add(api))
	mux.HandleFunc("/events/bulk", AddBulk(api))
	mux.HandleFunc("/proofs/membership", Membership(api))
	mux.HandleFunc("/proofs/digest-membership", DigestMembership(api))
	mux.HandleFunc("/proofs/incremental", Incremental(api))
	mux.HandleFunc("/info", InfoHandler(api))
	mux.HandleFunc("/info/shards", InfoShardsHandler(api))
	return mux
}
NewApiHttp returns a new *http.ServeMux containing the current API handlers.
/health-check -> Qed server healthcheck
/events -> Add event operation
/events/bulk -> Add event bulk operation
/proofs/membership -> Membership query using event
/proofs/digest-membership -> Membership query using event digest
/proofs/incremental -> Incremental query
/info -> Qed server information
/info/shards -> Qed cluster information
package apihttp
import (
	"encoding/json"
	"errors"
	"fmt"
	"net/http"
	"time"
	"github.com/bbva/qed/balloon"
	"github.com/bbva/qed/consensus"
	"github.com/bbva/qed/crypto/hashing"
	"github.com/bbva/qed/log"
	"github.com/bbva/qed/protocol"
	"github.com/hashicorp/raft"
)
type ClientApi interface {
	Add(event []byte) (*balloon.Snapshot, error)
	AddBulk(bulk [][]byte) ([]*balloon.Snapshot, error)
	QueryDigestMembershipConsistency(keyDigest hashing.Digest, version uint64) (*balloon.MembershipProof, error)
	QueryMembershipConsistency(event []byte, version uint64) (*balloon.MembershipProof, error)
	QueryDigestMembership(keyDigest hashing.Digest) (*balloon.MembershipProof, error)
	QueryMembership(event []byte) (*balloon.MembershipProof, error)
	QueryConsistency(start, end uint64) (*balloon.IncrementalProof, error)
	ClusterInfo() *consensus.ClusterInfo
	Info() *consensus.NodeInfo
	IsLeader() bool
}
type HealthCheckResponse struct {
	Version int    `json:"version"`
	Status  string `json:"status"`
}