Updated API to use key-value pairs instead of positional elements in arrays.