Added additional api route for refDocs

Added condition to take care of  type == ObjectId but not array.