returns errors to client