added try catch for view api requests