Data Migration

Improvements in scripts and API error handling.
Merge remote-tracking branch 'origin/develop' into develop