database writing operation api