Added some error handling

404 and 500