fix var leaks in tests
fix json posting for browser client
build