Changed error code syntax to be easily modifiable in future. Also made newUser return user ID upon success.