bug fixes

Takes into account modules vs api number.
Bug fix assuming there is a payload.