unit tests for endpoint