improved failure and error handling and added additional tests related to body handling