add ability to specify options like custom headers with rest calls
clean up tests