Fixed getProductById function to use array of results