cleaned up document status checking
404 for status code