The goal is to learn how to create abstractions and how control flow works, once you got that down you can think freely and just code whatever you need.
When learning a new API just implement some basic program in it, taking input in some way and creating output in some way. Like click button to display a text, or take command line argument and write a file saying hello world etc.