Returning results as JSON.