implemented generic input verification and json creation.