Return error codes instead of success/fail