This is an excellent approach to handling interactions with APIs (or databases, queues, etc.) I follow a similar pattern when creating Services for my applications. Have you considered using RxJS? I think it would compliment the way you handle different states and events nicely. Maybe take a look at Moya (a fantastic library for writing an API layer in Swift) for inspiration.