func GetServer(enc encoder.Encoder, db database.DB, parms martini.Params) (int, []byte) { fmt.Printf("begin get server\n") id, err := strconv.ParseInt(parms["id"], 10, 64) al := db.Get(id) if err != nil || al == nil { msg := fmt.Sprintf("the album with id %s does not exist", parms["id"]) return http.StatusNotFound, encoder.Must(enc.Encode( NewError{errcode: 404, errmsg: msg})) } return http.StatusOK, encoder.Must(enc.Encode(al)) }