Trending query Server Side Implementation

Trending query Server Side Implementation complete.