Fixed the code to receive JSON object for search query as POST request