Added support to pass as_json and include_docs to getByView function