bugfix with api

correcton of 500 error at api