moving API class into separate file