Some more error handling
Streamlining http requests and media queries