update api for storing functions