         fetch_session(conn)
         |> put_status(201)
         |> add_session(user)
-        |> json %{message: "user created"}
+        |> json %{message: "user created", user: user}
       end
 
       defp do_register({:error, message}, conn) do

        Entry point for registering new users.

       `params` needs to include email, password and username.
        Returns a JSON response in the format `{message: text}` with status `201` for
        successful creation, or `400` for when an error occurs.
        On success, it also logs the new user in.
      """

        Entry point for logging users in.

        Params needs to be populated with `email` and `password`. It returns `200`
        status code along with the JSON response `{message: "logged in", user: %User{}` or `400`
        with `{message: "invalid email or password"}`

       """
