checks api for solution and returns a flash message