adding site id to external apply
Merge pull request #143 from cbdr/add_session_id_to_external_apply

adding session id to external apply
syncing my branch with master and fixing conflict.