add 500 and 404 templates; render 500 templates when Q module enounters errors while making promises