Modify API to return error as a multiple return value
Update examples in README