Add toArray method to Response