Fix n + 1 query in api/boards_controller