I'm writing a set of modules that will function as sort of a data access API (mostly reading/writing data in an sql database) that will be used by other (yet-to-be-written) modules that will be developed to add capability to a web application that runs under mod_perl.
As a separate point I generally find it far more effective to develop an API after the modules that need it rather than before. Instead of an educated guess about how it should behave you get concrete examples.
Have you considered starting with developing the modules and then factoring out the data layer API once you see the duplication that necessitates it?