solved problem in API get, updated REST api code