Updated to return JSON.