Updated Directory Checks

Now check if specific stocks exist before serving them up to avoid a
broken page. Created a function that creates error functions. Used it to
make send404 and send500 methods.