get format for output and set accept headers accordingly