refactoring preparing TMS without session check
added munge auth: needs to be improved