Starting basic server response algorithm

Not sure this is right