Additional REST API tests, few code cleanups along the way