Refactor api's classes to easier migration to v2 api