Fix API response function.