On the path to add an API. Updated to have json response.