added batch writing
added a test if the size of request is too big