before_filter for the api only on certain methods