api/util/json: properly handle HTTP No Content, write server error if no function writes a response
api/util/json_test: add function chaining tests, remove incorrect behavior test