I refer to http://api-first.com/ . The idea is, after wrote the stories needed to define interaction, and thus functions, of the system we are going to implement, the next step is to define an api, then proceed with API definition, then implement backend, frontend, and cycle this way redefining stories (or adding), refining api, change frontend and backend. This is not water fall, is just a sequence to follow in the cycle, something like rithm keeper (metronome?), of development process.