api and hardware code