Fixed view bugs and added api route