change architecture for suiting flexible api design