add date value to sql querry for api/problems