Bug fix in save method

When saving new record, $collection->items needs to be type casted to an Array, instead of Object, to keep the count of it incremental. Otherwise, it returns 1, and save method always overwrite the last record in JSON collection.