added implementation for emptyBody check
some error handling and tests
Merge pull request #1 from cosmosgenius/detect-empty-body

Detect empty body