Smarter approach to API