refactored endpoint test a bit