API definition and views