working api + api tests