fixing the response to serialise and sort