extracted api methods into its own class