write requests to database asynchronously