switched from html responses to json responses