move vm in separate file, fix ajax requests