Changed API to use a data array inside the main array to avoid confusion.