flask: learning API creation