rest-api clean ups and tests