api.array :wk_clkinout, api_meta(:total_count => @entry_count, :offset => @offset, :limit => @limit, unseen_count: @unseen_count) do
    @clk_entries.each do |clk_entry|
      api.clk_entry do
        api.id clk_entry.id
        api.user_id clk_entry.user.id if clk_entry.user.present?
        api.name clk_entry.user.name if clk_entry.user.present?
        api.clock_in clk_entry.start_time.localtime.strftime('%R') if clk_entry.start_time.present?
        api.clock_out clk_entry.end_time.localtime.strftime('%R') if clk_entry.end_time.present?
        api.hours clk_entry.hours
        api.startdate clk_entry.entry_date.to_date
        api.s_longitude clk_entry.s_longitude
        api.s_latitude clk_entry.s_latitude
        api.e_longitude clk_entry.e_longitude
        api.e_latitude clk_entry.e_latitude
      end
  end
end
