Backend diary api and error handling