minor fixes and rest api tests.