added try-catch-block

@rbran100
Following changes were put in 
a)added try-catch block to page-views and site-visits
b)added variables for array slicing of min and max