Utilities for building API