Adds etag support
Refactors prepare case statement (breaks error_spec tests)