Add read, write, and better error reporting