only pass URL values to responseFormat
add test for responseFormat
refactor rendering

- move HTML and JSON rendering to a function
- responseFormat got a default case