Fix submit function returning nil objects when response was valid