API programming tutorial