Types for Correct Communication in Client-Server Systems