func createServices(e encoder, adapter PanamaxAdapter, r *http.Request) (int, string) {
	var services []*Service
	err := json.NewDecoder(r.Body).Decode(&services)
	if err != nil {
		return http.StatusInternalServerError, err.Error()
	}
	res, err := adapter.CreateServices(services)
	if err != nil {
		return handlePotentialPanamaxError(err)
	}
	return http.StatusCreated, e.Encode(res)
}
The handler to create a list of services.

Services posted to this handler will be created in order
and if successful the response will contain a list of id and actualState
for each provided service.

Refer to https://github.com/CenturyLinkLabs/panamax-ui/wiki/Adapter-Developer's-Guide
package pmxadapter
import (
	"encoding/json"
	"net/http"
	"github.com/codegangsta/martini"
)
func sanitizeErrorCode(code int) int {
	if http.StatusText(code) == "" {
		return http.StatusInternalServerError
	}
	return code
}
func getServices(e encoder, adapter PanamaxAdapter) (int, string) {
	data, err := adapter.GetServices()
	if err != nil {
		return handlePotentialPanamaxError(err)
	}
	return http.StatusOK, e.Encode(data)
}
func getService(e encoder, adapter PanamaxAdapter, params martini.Params) (int, string) {
	id := params["id"]
	data, err := adapter.GetService(id)
	if err != nil {
		return handlePotentialPanamaxError(err)
	}
	return http.StatusOK, e.Encode(data)
}