//creates a new response from a dynmap func NewResponseDynMap(mp *dynmap.DynMap) *Response { strest := mp.MustDynMap("strest", dynmap.New()) status := mp.MustDynMap("status", dynmap.New()) mp.Remove("strest") mp.Remove("status") response := &Response{ DynMap: *mp, txnId: strest.MustString("txn.id", ""), txnStatus: strest.MustString("txn.status", "completed"), statusCode: status.MustInt("code", 200), statusMessage: status.MustString("message", "OK"), } return response }