Code for CHAT's REST interface and storage backend