   end
 
   @invalid_data_size_json JSX.encode!(%{error: "Data key must be smaller than 10KB"})
+
+  @doc """
+  The event data can't be greater than 10KB
+  """
   def valid_entity_length(req, %{event: event} = state) do
     valid = byte_size(event.data) <= 10_000
     unless valid do

  end

  @authentication_error_json JSX.encode!(%{error: "Authentication error"})
  # http://pusher.com/docs/rest_api#authentication
  def is_authorized(req, %{body: body} = state) do
    {qs_vals, req} = :cowboy_req.qs_vals(req)
    {method, req} = :cowboy_req.method(req)

    {valid, req, state}
  end

  @doc false
  def content_types_accepted(req, state) do
    {[{{"application", "json", :*}, :post}], req, state}
  end

  @doc false
  def content_types_provided(req, state) do
    {[{{"application", "json", []}, :undefined}], req, state}
  end

  @doc false
  def post(req, %{event: event}) do
    PusherEvent.publish(event)
    Event.notify(:api_message, %{channels: event.channels, name: event.name})
