Factored out make_mock_json_response function