I'm no rails developer, but it seems to me that the problem is:
"iTotalRecords" => @products.count,
@products.count
it's the record count when the query is already paginated (always 10 or less depending on the page).
Try setting this value to the total number of records of the query whitout any pagination.