API v6 update

Refactored script to make it elastic dicts.