Added server code and test code