change Encoder from interface to func type,another version of middleware implementation,followed https://github.com/rif/martini-api-example