return json response properly