I'll often do similar if I'm exposing a library... I usually want to work out the semantics and API for how to use the library before actually writing the interface.
Interestingly enough, my personal philosophy is to write all backend code as if it is a library for my future self.
That is to say, I want to be able to forget everything about a project and still have the resources I need to use the project code as if it were a black box consumable library.
That is to say, I want to be able to forget everything about a project and still have the resources I need to use the project code as if it were a black box consumable library.