hacking more stuff in to support testing, added flag to support the output of the response