Add unit tests for client functions