implemented REST api