Designing an API