Add access logic to API