check err and body.error in addInDatabase