move commond code for executor backends
add temp directory api
changed session logic to not create unnessesary sessions