Changed the headers so they are actually valid
Added code to check the validity of the headers and ensure it is talking to a client