Add HTTP status code as `code` to error object

It's not very good to rely on `error.message`, which is string like `Not Found`, to handle specific errors, so it would be really nice to have an access to the actual HTTP status code. That also means the documentation for `REST API` should also be improved by adding information about available HTTP status codes and their meanings.