improve specs, work on error handling

I simplified this because I didn't see the need for users to set custom headers. We can complexify it later if we have the need. But let me know if I'm missing something.