Domain API changes 1

-improved domain API structure
Domain API changes

-improved structure and api flexibility