func getChats(r render.Render, params martini.Params, re *http.Request, f *fishhub.DBService, chat chat.Chat) { chat.Db = f chats, err := chat.GetChats() if err != nil { displayUnknownError(r) return } r.JSON(200, chats) }