Please help to fix all restAPIs to return json and avoid 500 error code.