#488 Refactored api authorization and error handling
#488 Added piston to our code so we can tweak it as needed