Refactor submit script to use python for parsing json