Adding memoization, improved tests for HttpApi