func (r *marathonClient) CreateGroup(group *Group) error {
	return r.apiPost(marathonAPIGroups, group, nil)
}
CreateGroup creates a new group in marathon
group:			a pointer the Group structure defining the group
package marathon
import (
	"fmt"
	"time"
)
type Group struct {
	ID           string         `json:"id"`
	Apps         []*Application `json:"apps"`
	Dependencies []string       `json:"dependencies"`
	Groups       []*Group       `json:"groups"`
}
type Groups struct {
	ID           string         `json:"id"`
	Apps         []*Application `json:"apps"`
	Dependencies []string       `json:"dependencies"`
	Groups       []*Group       `json:"groups"`
}
type GetGroupOpts struct {
	Embed []string `url:"embed,omitempty"`
}
type DeleteGroupOpts struct {
	Force bool `url:"force,omitempty"`
}
type UpdateGroupOpts struct {
	Force bool `url:"force,omitempty"`
}
func NewApplicationGroup(name string) *Group {
	return &Group{
		ID:           name,
		Apps:         make([]*Application, 0),
		Dependencies: make([]string, 0),
		Groups:       make([]*Group, 0),
	}
}
func (r *Group) Name(name string) *Group {
	r.ID = validateID(name)
	return r
}
func (r *Group) App(application *Application) *Group {
	if r.Apps == nil {
		r.Apps = make([]*Application, 0)
	}
	r.Apps = append(r.Apps, application)
	return r
}
func (r *marathonClient) Groups() (*Groups, error) {
	groups := new(Groups)
	if err := r.apiGet(marathonAPIGroups, "", groups); err != nil {
		return nil, err
	}
	return groups, nil
}
func (r *marathonClient) Group(name string) (*Group, error) {
	group := new(Group)
	if err := r.apiGet(fmt.Sprintf("%s/%s", marathonAPIGroups, trimRootPath(name)), nil, group); err != nil {
		return nil, err
	}
	return group, nil
}
func (r *marathonClient) GroupsBy(opts *GetGroupOpts) (*Groups, error) {
	u, err := addOptions(marathonAPIGroups, opts)
	if err != nil {
		return nil, err
	}
	groups := new(Groups)
	if err := r.apiGet(u, "", groups); err != nil {
		return nil, err
	}
	return groups, nil
}
func (r *marathonClient) GroupBy(name string, opts *GetGroupOpts) (*Group, error) {
	u, err := addOptions(fmt.Sprintf("%s/%s", marathonAPIGroups, trimRootPath(name)), opts)
	if err != nil {
		return nil, err
	}
	group := new(Group)
	if err := r.apiGet(u, nil, group); err != nil {
		return nil, err
	}
	return group, nil
}
func (r *marathonClient) HasGroup(name string) (bool, error) {
	uri := fmt.Sprintf("%s/%s", marathonAPIGroups, trimRootPath(name))
	err := r.apiCall("GET", uri, "", nil)
	if err != nil {
		if apiErr, ok := err.(*APIError); ok && apiErr.ErrCode == ErrCodeNotFound {
			return false, nil
		}
		return false, err
	}
	return true, nil
}