Made sure responses to HEAD requests have no body, refactored unit tests