[Reviewer: Alex] Handler fixes

Alex, can you please review these changes to the Handlers. This fixes up the SAS trail, uses HTTPCodes instead of int and fixes a memory leak. I've also bulked out the UTs. 

Fixes #581