Add tests for peer API