Fixed the api based on the tests of the gson branch