added direct intergration and options to switch between direct and hosted form