Handle error cases
Finish frontend