Fixes and improvements for the REST API