A little refactoring to simplify test set up and enable alternate status codes to be returned. Default status code is still OK