Implement Rmdir for document directories
Check for HTTP status errors when not using api-client
Add debug switch
Don't ignore signals after receiving the first one