Added functionality to make API request and pass results to client