Add unit tests for server functions