Fixes format parameter
Improves error handling in html clients