Merged from fs0006 (includes REST API functionality)