Add error handling to fetch exercise endpoint