Added API stuff to before-filters