making json work without the need to call end()