refactor endpoints_test
refactor domains api test