Refactored API endpoint for /clients/<name>/history array list