backend: handling errors