Changes in API. Added sync implementation

- Arrays replaced with objects when defining targets/endpoints
- Added support for custom sync implementation