Tidy up handling of incoming requests and their serialization. This may be functionally unchnaged - it was in response ot a perceived error.