Fixed error 500 in API