Write api to store and generate id

Signed-off-by: Ramnique Singh <mail@ramniquesingh.name>